Monday, October 6, 2008

How to fix mysql thread_stack overrun?

Today I faced a problem about running my stored procedure code and I got the error message :

#1436: Thread stack overrun: 4136 bytes used of a 131072 byte stack, and 131072 bytes needed. Use 'mysqld -O thread_stack=#' to specify a bigger stack.
I tried the command mysqld -O thread_stack=# but it did not worked. Then I entered my.cnf file which is at /etc/my.cnf I found the value of thread_stack which is not 4136 bytes, its value is 128K(131072 byte).
I thought that the value was true but I changed it to 512K. Here is my configuration:

port = 3306
socket = /var/lib/mysql/mysql.sock
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 128
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 512K

Now, it is working well with 40000 row datas.

No comments: