我得到了错误代码:2013。当我试图使用MySQL工作台向表添加索引时,在查询错误期间失去了与MySQL服务器的连接。 我还注意到,每当我运行长查询时,它就会出现。
是否有增加超时值的方法?
我得到了错误代码:2013。当我试图使用MySQL工作台向表添加索引时,在查询错误期间失去了与MySQL服务器的连接。 我还注意到,每当我运行长查询时,它就会出现。
是否有增加超时值的方法?
当前回答
检查有关
OOM on /var/log/messages ,
modify innodb_buffer_pool_size value ; when load data , use 50% of os mem ;
希望这能有所帮助
其他回答
有时候你的SQL-Server会陷入死锁,我已经遇到过这个问题100次了。你可以重启你的电脑/笔记本电脑来重启服务器(简单的方法),或者你可以去任务管理器>services> your - server - name(对我来说,它是MySQL785之类的)。然后右键单击> restart。 重试执行查询。
我知道它很老,但在mac上
1. Control-click your connection and choose Connection Properties.
2. Under Advanced tab, set the Socket Timeout (sec) to a larger value.
这发生在我身上,因为我的innodb_buffer_pool_size被设置为大于服务器上可用的RAM大小。事情因此被中断,然后它发出这个错误。修复方法是用正确的innodb_buffer_pool_size设置更新my.cnf。
只需执行一次MySQL升级,将重新构建innoDB引擎,并重新构建MySQL正常运行所需的许多表,如performance_schema, information_schema等。
从你的shell中发出下面的命令:
sudo mysql_upgrade -u root -p
如果您在恢复一个大转储文件期间遇到这个问题,并且可以排除与网络有关的问题(例如在本地主机上执行),那么我的解决方案可能会有帮助。
我的mysqldump至少有一个INSERT太大,mysql无法计算。你可以通过输入show变量"net_buffer_length";在你的mysql-cli中。 你有三种可能:
increase net_buffer_length inside mysql -> this would need a server restart create dump with --skip-extended-insert, per insert one line is used -> although these dumps are much nicer to read this is not suitable for big dumps > 1GB because it tends to be very slow create dump with extended inserts (which is the default) but limit the net-buffer_length e.g. with --net-buffer_length NR_OF_BYTES where NR_OF_BYTES is smaller than the server's net_buffer_length -> I think this is the best solution, although slower no server restart is needed.
我使用以下mysqldump命令: mysqldump——skip-comments——set-charset——default-character-set=utf8——single-transaction——net-buffer_length 4096 DBX >转储文件