bug info
报错信息:
java.sql.SQLException: Thread stack overrun: 5456 bytes used of a 131072 byte stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack.
官方相应信息:
The default (192KB) is large enough for normal operation. If the thread stack size is too small, it limits the complexity of the SQL statements that the server can handle, the recursion depth of stored procedures, and other memory-consuming actions
可以使用
show variables where `variable_name` = 'thread_stack';
查询当前数据库的默认线程栈的大小,一般情况下都能正常使用,但是当查询语句或者存储过程复杂时会报Thread stack overrun
错误,此时只要修改默认配置就可以。
解决
windows
: 修改mysql安装目录下的my-small.ini
或者my.ini
设置为256k,或者更大,然后重启服务
[mysqld]
thread_stack = 256k
linux
: 同样要修改配置文件,但是!!!,不是安装目录下的配置文件,是/etc/my.cnf
,只有这个文件才能生效,然后重启服务service mysql restart
[mysqld]
thread_stack = 256k