ERROR 2013 (HY000): Lost connection to MySQL server during query(已解决)

1.问题描述

  • 使用mycat连接逻辑库创建表时,出现问题ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> create table orders(name varchar(32));
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
Enter password: 
Connection id:    5
Current database: TESTDB

2.解决办法

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
# 开启binlog
# 日志文件前缀
log-bin=mysql-bin
# binlog日志保留的天数,清除超过10天的日志
# 防止日志文件过大,导致磁盘空间不足
expire-logs-days=10
# 跳过错误操作
slave-skip-errors=all
#此处开始必须添加
skip-name-resolve
default-authentication-plugin=mysql_native_password
max_allowed_packet = 500M
net_read_timeout = 120
net_write_timeout = 900

3.效果

mysql> create table orders(name varchar(32));
Query OK, 0 rows affected (0.01 sec)
  • 问题已解决
  • 也改过别的地方,但是个人认为不是很重要,有需要的欢迎交流,楼主弄了好几天
Logo

华为云1024程序员节送福利,参与活动赢单人4000元礼包,更有热门技术干货免费学习

更多推荐