MySQL 批量写入数据报错:mysql_query:Lost connection to MySQL server during query
2018-07-12 15:00
531 查看
场景:
批量往mysql replace写入数据时,报错。
解决方法:
1.增大mysql 数据库配置中 max_allowed_packet 的值
max_allowed_packet = 1G (默认是1M,最大只能为1G)
2.检查自己代码中 mysql 连接函数中设置的查询超时参数 :MYSQL_OPT_READ_TIMEOUT,可以设置大一点
查询超时时间为 optvalue 的 3 倍。也就是10*3=30s.
如果设置了MYSQL_OPT_RECONNECT(),那么mysql_query()是可以完成自动重连的。
相关文章推荐
- Mysql 插入大数据量数据报错:Lost connection to MySQL server during query
- MySQL报错:ERROR 2013 (HY000): Lost connection to MySQL server during query
- Mysql导入Sql文件时报Error Code: 2013 - Lost connection to MySQL server during query
- 错误代码: 2013 Lost connection to MySQL server during query
- General error: 2013 Lost connection to MySQL server during query
- mysql 由in引起的 [Err] 2013 - Lost connection to MySQL server during query 的解决
- MySQL存盘阻塞“Lost connection to MySQL server during query”
- Lost connection to MySQL server during query
- Mysql mysql lost connection to server during query 问题解决方法
- mysql5.5一插入数据就提示ERROR 2013 (HY000): Lost connection to MySQL server during query,且mysql服务自动关闭
- Procedure execution failed 2013 - Lost connection to MySQL server during query
- MySQL server has gone away 或 lost connection to MySQL server during query
- MySQL error 2013 : Lost connection to MySQL server during query
- PHP+MYSQL出错(#2013 - Lost connection to MySQL server during query)
- [Err] 2013 - Lost connection to MySQL server during query
- Mysql mysql lost connection to server during query 问题解决方法
- Procedure execution failed 2013 - Lost connection to MySQL server during query
- 【转】解决Lost connection to MySQL server during query错误方法
- 2013 lost connection to mysql server during query
- 解决:Ubuntu上,Python3 连接Win 7上的MySQL57数据库,报错误:(2013, ‘Lost connection to MySQL server during query’)