MySQL Error: THREAD STACK OVERRUN

Follow

Environment

Zend Server, MySQL Server

Issue

When running transaction against MySQL, you might get an error similar to this:

SQLSTATE[HY000]: GENERAL ERROR: 1436 THREAD STACK OVERRUN: 8992 BYTES USED OF A 131072 BYTE STACK, AND 128000 BYTES NEEDED. USE 'MYSQLD --THREAD_STACK=#' TO SPECIFY A BIGGER STACK.

Troubleshooting

To check the current thread_stack value, which is usually the default, connect to MySQL and run the query:

> SHOW VARIABLES LIKE '%thread_stack%';

Solution

You should raise the thread_stuck to 256k, which is usually enough to avoid this problem permanently.

1. Backup and Edit my.cnf, locate thread_stack directive and modify to 256k

2. Restart MySQL service to reload new configuration

3. Run your PHP script or test again

Note: If the solution is not working for you, please open a support ticket and we will be happy to assist you further.

References

MySQL Forums: thread stack overrun in MySQL 5.1.33

MySQL System Variables - Thread Stack

MySQL Reference - How MySQL Uses Memory

Zend Server on Mac - MySQL Service Management (bottom of the page)

Have more questions? Submit a request

Comments

Powered by Zendesk