ERROR 2005(HY000) unkonw MySQL server host

Q:MySQL还原备份出错 ERROR 2005(HY000) unkonw MySQL server host
A:新建数据库utf8
mysql -u root -p --default-character-set=utf8
use test;
set names utf8;
source e:\123\123.sql;


调大了 connect_timeout 和 wait_timeout的值
show global variables like '%timeout';
set global INTERACTIVE_TIMEOUT=2880000;
set global WAIT_TIMEOUT=2880000;


SQL语句太大了,查看一下允许的最大包大小:
show global variables like 'max_allowed_packet'; 
value/1024/1024为现在大小,修改参数值为256M(1024*1024*256)
set global max_allowed_packet=1073741824;

参考链接
https://www.cnblogs.com/ivictor/p/5979731.html
https://blog.csdn.net/fdipzone/article/details/51974165

mysql升级5.6至5.7
参考链接
https://www.cnblogs.com/java-123/p/10624600.html
posted @ 2020-07-14 16:40  kylingx  阅读(2162)  评论(0编辑  收藏  举报