mysql导入文件报错

mysql在导入文件的时候,会莫名的报错,报错信息如下:

ERROR 1231 (42000): Variable ‘time_zone’ can’t be set to the value of ‘NULL’
ERROR 1231 (42000): Variable ‘sql_mode’ can’t be set to the value of ‘NULL’
ERROR 1231 (42000): Variable ‘foreign_key_checks’ can’t be set to the value of ‘NULL’
ERROR 1231 (42000): Variable ‘unique_checks’ can’t be set to the value of ‘NULL’
ERROR 1231 (42000): Variable ‘character_set_client’ can’t be set to the value of ‘NULL’
ERROR 1231 (42000): Variable ‘collation_connection’ can’t be set to the value of ‘NULL’
ERROR 1231 (42000): Variable ‘sql_notes’ can’t be set to the value of ‘NULL’

刚一看还不知道啥问题,其实就是数据库配置的问题.
修改mysql的配置文件,设置max_allowed_packet=1024M即可.

设置完,可以通过如下命令查看

show VARIABLES like '%max_allowed_packet%';

You May Also Like