How to fix Thread stack overrun with mysql 5.7 (and other versions) Thread stack overrun with mysql 5.7 on Linux and Windows Run the server with mysqld --thread_stack=256k to configure my.ini/my.cnf (server.cnf) add: thread_stack = 256K Further problems with mysql on windows On 64 bit (windows) probably you will need to give a bigger value I've been forced to use thread_stack = 512K on MySQL Ver 5.6.38 for Win64 on x86_64 (MySQL Community Server (GPL)) Generic errors with mysql_upgrade ERROR 1436 (HY000) at line 1879: Thread stack overrun ERROR 1436 (HY000) at line 1935 Use 'mysqld --thread_stack=#' to specify a bigger stack