狐狸.fox 2008-09-18 14:38 采纳率: 0%
浏览 525
已采纳

Mysql 错误1153-得到的数据包大于允许的最大数据包字节

I'm importing a MySQL dump and getting the following error.

$ mysql foo < foo.sql 
ERROR 1153 (08S01) at line 96: Got a packet bigger than 'max_allowed_packet' bytes

Apparently there are attachments in the database, which makes for very large inserts.


This is on my local machine, a Mac with MySQL 5 installed from the MySQL package.

Where do I change max_allowed_packet to be able to import the dump?

Is there anything else I should set?

Just running mysql --max_allowed_packet=32M … resulted in the same error.

转载于:https://stackoverflow.com/questions/93128/mysql-error-1153-got-a-packet-bigger-than-max-allowed-packet-bytes

  • 写回答

13条回答 默认 最新

  • 胖鸭 2008-09-19 18:10
    关注

    You probably have to change it for both the client (you are running to do the import) AND the daemon mysqld that is running and accepting the import.

    For the client, you can specify it on the command line:

    mysql --max_allowed_packet=100M -u root -p database < dump.sql
    

    Also, change the my.cnf or my.ini file under the mysqld section and set:

    max_allowed_packet=100M
    

    or you could run these commands in a MySQL console connected to that same server:

    set global net_buffer_length=1000000; 
    set global max_allowed_packet=1000000000;
    

    (Use a very large value for the packet size.)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(12条)

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题