寻觅生命中的那一片浅草......

MySQL – Got a packet bigger than ‘max_allowed_packet’

The default maximum allowed packget size is 1MB, so if you store some large binaries in your database you might get some problems. All you need to do is re-set the maximum size to a larger number.

Macintosh:trunk jennyfong$ mysql -uroot database_name < database_backup.sql

ERROR 1153 (08S01) at line 2365: Got a packet bigger than ‘max_allowed_packet’ bytes
Macintosh:trunk jennyfong$ mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 25
Server version: 5.0.86 MySQL Community Server (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> set global net_buffer_length=10000000;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> set global max_allowed_packet=1000000000;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
Macintosh:trunk jennyfong$ mysql -uroot database_name < database_backup.sql

show variables like ‘max_allowed_packet’;

尚无评论

发表评论

2024年四月
« 5月    
1234567
891011121314
15161718192021
22232425262728
2930