Increasing mysql import size

后端 未结 3 1502
野性不改
野性不改 2021-02-11 00:22

I am trying to import a mysql file to my cpanel phpmyadmin. But I am getting this error message. \"#1153 - Got a packet bigger than \'max_allowed_packet\' bytes\"

I have

3条回答
  •  天涯浪人
    2021-02-11 01:04

    This error has nothing to do with the php.ini, its clearly an error message from the DBMS.

    You can increase the value of the max_allowed_packet in the my.cnf file:

    [mysqld]
    max_allowed_packet = 128M
    

    After restarting your mysqld it should work (for larger data increase the value more)

    If you try to "import with putty", i guess your are using mysql from command line, in this case you can start mysql with the --max_allowed_packet parameter e.g:

    mysql --max_allowed_packet=128M -u root -p sampledb < dump.sql
    

    Alternatively if you source the file from within a running mysql session you can set the parameter by:

    set global max_allowed_packet=128M;
    

    last example only is effective till next restart of mysqld, for a permanent solution stick to my first example.

提交回复
热议问题