1. 程式人生 > >MySQL資料匯入sql檔案過程中出錯

MySQL資料匯入sql檔案過程中出錯

錯誤型別:

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> set max_allowed_packet=1024M;  --只對當前會話生效

    mysql> source ./xxxx.sql;

 方式二: 永久生效修改my.cnf

    [[email protected] ~]# vim /etc/my.cnf
    [mysqld]
      max_allowed_packet = 500M

    [mysqldump]
      quick
      max_allowed_packet = 500M


參考文章:http://www.bubuko.com/infodetail-646948.html