Mysql Error Code : 1436 Thread stack overrun

ERRNO: 256 
TEXT: SQLSTATE[HY000]: General error: 1436 Thread stack overrun: 4904 bytes used of a 131072 byte stack, and 128000 bytes needed. Use 'mysqld -O thread_stack=#' to specify a bigger stack.

According to the MySQL manual “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” .

To resolve this issue you need to change the default value of parameter 'thread_stack' in /etc/my.cnf  in your MySQL configuration file. I use the XAMPP for php/mysql development.

Once you set this value you need to restart MySQL as this value cannot be set dynamically.

you maybe also encounter with the message when you try to modify the my.cnf

"Cannot open file for writing: Permission denied"

We will try to use the 'chmod' instruction to change permission as usually. I seldom take the concrete permission into consideration, so I use always use the 'chmod 777'. but it resulted in another errors when I use the phpmyadmin, another tools included in XAMPP, after running 'chmod 777'.

After googling it, I get this file (my.cnf) permissions has to be 600. I change its permission and it works well now.
if ($ != jQuery) {
$ = jQuery.noConflict();
}
var isLogined = false;
var cb_blogId = 76437;
var cb_entryId = 2096531;
var cb_blogApp = "wildboar";
var cb_blogUserGuid = "d3ab0d9b-49ca-df11-ac81-842b2b196315";
var cb_entryCreatedDate = '2011/7/2 23:15:00';

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

其实针对32位系统,32G内存,一般设置为512K即可,据国外网站看到的,如果是64位的系统可以适当增加,其实够用就好了,没必须刚开始设置的就很大。

(0)

相关推荐

  • MySQL多线程复制遇到Error_code: 1872的解决方案

    上周在生产环境上遇到一个问题,不敢独享,拿出来给小伙伴们做个简单的分享. 起因 :由于IDC机房断电(估计又是哪里被挖掘机碰了下吧),导致所有服务器重启,影响到了其中的MySQL数据库.来看下这时数据库遇到的问题: 数据库版本 :MySQL 5.7.10 问题表现 :从机复制报如下错误:Slave SQL for channel ": Slave failed to initialize relay log info structure from the repository, Error_co

  • 解析mysql数据库还原错误:(mysql Error Code: 1005 errno 121)

    原因大致是主键必须是唯一的,也就是数据库里可能存在和现还原数据库有重复的地方,a restriction that Foreign Keys should be uniquely named throughout the database , 一个有效的办法就是将原来的数据库清除后再创建还原. 本人这回的原因是新装的mysql的ibdata1备份文件被我换成之前数据库的ibdata1备份文件了,本来想通过这方法来强制还原的,但是没做到,结果用备份sql文件还原以前数据的数据库时也出错,将被替换的

  • Mysql Error Code : 1436 Thread stack overrun

    ERRNO: 256  TEXT: SQLSTATE[HY000]: General error: 1436 Thread stack overrun: 4904 bytes used of a 131072 byte stack, and 128000 bytes needed. Use 'mysqld -O thread_stack=#' to specify a bigger stack. According to the MySQL manual "The default (192KB)

  • MySQL删除外键时报错Error Code:1091. Can‘t DROP ‘XXX‘的解决方法

    解决MySQL删除外键时报错Error Code: 1091. Can't DROP 'XXX'; check that column/key exists 长期不写基础的 MySQL 代码,笔者也开始犯一些低级错误.最近,笔者在尝试将表中某列的外键约束删除时,MySQL 却一直报该列本就不存在的错误. 笔者报错时的运行环境: MySQL 8.0.27 Windows 10 教育版 Error Code: 1091. Can't DROP 'XXX'; check that column/key

  • ERROR CODE: 1175 YOU ARE USING SAFE UPDATE MODE AN

    快速高效用:SET SQL_SAFE_UPDATES = 0:下面的就不要看了! 今日用MySQL Workbench进行数据库的管理更新时,执行一个更新的语句碰到以下错误提示: 复制代码 代码如下: Error Code: 1175 You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column 进过一番搜索之后发现原来是MySQL Workbench的安

  • 解决MySQL5.1安装时出现Cannot create windows service for mysql.error:0

    安装MySQL5.1过程中,我把以前MySQL5.0的GUI工具和服务器全部删掉,安装目录全部删掉,数据文件目录名字改掉,注册表用完美卸载清理了.  然后重启安装MySQL5.1(我以前遇到过服务启动不了的情况,这样做就搞定了),可配置到最后一步时出现Cannot create windows service for MySQL.error:0错误,把配置工具关掉重试几次都不行,后来百度了下,听说要在系统管理员用户下执行sc delete mysql删除MySQL服务后再启动配置工具配置,实在不

  • 新装MySql后登录出现root帐号提示mysql ERROR 1045 (28000): Access denied for use的解决办法

    新装MySQL后,首次执行 mysql -uroot -p 后会发现root密码不为空,要重置root密码请参考以下步骤. 编辑mysql配置文件my.ini(如果是my_default.ini请改名为my.ini),在[mysqld]这个条目下加入 skip-grant-tables 保存退出后重启mysql,点击"开始"->"运行"(快捷键Win+R). 1.停止:输入 net stop mysql 2.启动:输入 net start mysql 这时候在

  • MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 的原因分解决办法

    MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 的解决办法和原因 这两天下载了MySQL5.7.11进行安装,发现到了初次使用输入密码的时候,不管怎样都进不去,即使按照网上说的在mysqld 下面添加skip-grant-tables也是不行,后来研究了两天,终于找出原因和解决办法. 复制代码 代码如下: [mysqlld] skip-grant-tables: 原因

  • MySql Error 1698(28000)问题的解决方法

    一,问题描述: MysqlERROR1698(28000)解决,新装了mysql-server-5.7,登录为这一问题,普通用户不能进mysql,只有root用户才能进,并且不需要任何密码. ~$ mysql -u root -p Enter password: ERROR 1698 (28000): Access denied for user 'root'@'localhost' 二,解决步骤: 停止mysql服务 ~$ sudo service mysql stop 以安全模式启动MySQ

  • MySQL ERROR 1045 (28000) 错误的解决办法

    错误现象: ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)  ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: YES) windows下,以上两个错误的解决方法,本人亲测有效,现分享解决方案如下: 1.找到配置文件my.ini  ,然后将其打开,可以选择用记事本打开. 2

  • MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)问题的解决

    第一种方法: 推荐错误描述: Mysql中添加用户之后可能出现登录时提示ERROR 1045 (28000): Access denied for user的错误. 原因分析: 在mysql.user表中可能出现user为空的记录,如: mysql> select host,user from user; +------------------+------+ | host | user | +------------------+------+ | % | test | | localhost

随机推荐