1、mysql調用存儲過程 call proc1() 時報錯:
Thread stack overrun: 6656 bytes used of a 8496 byte stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack.
2、錯誤原因:
thread_stack太小,默認 128K。
3、解決方法:
windows:在這個文件中my-small.ini thread_stack 建議調整到500K
linux:在my.cnf中配置thread_stack的值可解決此問題。一般可配置為256K。
在my.cnf的[mysqld]小節中加入下面的配置:
thread_stack=256K
保存,重啟mysql服務即可。
4、查看配置是否生效
進入mysql命令環境中,用以下命令進行查看:
show variables like '%thread%';
mysql會顯示出相應的配置參數,確定thread_stack項的value是否為期望值。