magento sql 4G 匯入報錯

davissuperman發表於2015-11-04

http://injustfiveminutes.com/2013/02/14/errors-restoring-mysql-database-dump-on-wamp-environment/

Errors restoring MySQL database dump on WAMP environment


You have maybe happened to get lots of errors when sourcing a .SQL database dump into a new WAMP installation, looking like these:

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’
Query OK, 0 rows affected (0.00 sec)

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’

The above errors where thrown trying to restore a Drupal database dump and lead to think there’s a clash among MySQL servers versions.

However, it all has to do with the maximum allowed size of blog fields within the database which defaults to 16MB.

Try to make it arbitrarily high temporarily by typing in:

mysql> set global max_allowed_packet=1000000000;

Then source your dump again:

mysql> source ./my_db.sql;

Finally restart your Wamp server to leave max_allowed_packet back to its default value.


相關文章