kakuilan / china_area_mysql

中国5级行政区域mysql库
5.19k stars 1.23k forks source link

MySQL server has gone away #11

Open DingSoung opened 7 years ago

DingSoung commented 7 years ago

命令 mysql> source file_name.sql;mysql -u root -p database_name < file_name.sql 都失败了 还有别的办法没有

kakuilan commented 7 years ago

把mysql配置的max_allowed_packet改大点,比如 max_allowed_packet=1024M

erdongmaqiao commented 6 years ago

这个问题解决了么,怎么解决的啊

ghost commented 6 years ago

hi, @elliot-cj @DingSoung 如@kakuilan 所说, 在my.cnf中把max_allowed_packet改大点即可. 我在的环境是docker MySQL5.7, 使用mysql命令行输入:

set global max_allowed_packet = 200*1024*1024

重连后就可以导入了

jingyuexing commented 4 years ago

把mysql配置的max_allowed_packet改大点,比如 max_allowed_packet=1024M

编码要不要换成UTF-8啊

jingyuexing commented 3 years ago

使用navicat链接本地数据库,也更改了max_allowed_packet但是从第一行就开始报错了,换到了Ubuntu系统,直接执行source 命令,也是直接报错

jingyuexing commented 3 years ago

已经解决了,在命令行当中执行set global max_allowed_packet = 1024*1024*1024;后就行了

FightingFranky commented 3 years ago

Incorrect string value: '\xA7\x94\xE4\xBC\x9A' for column 'name' at row 1 还是出现了字符串不兼容的情况

kakuilan commented 3 years ago

Incorrect string value: '\xA7\x94\xE4\xBC\x9A' for column 'name' at row 1 还是出现了字符串不兼容的情况

字符编码