I’m importing a MySQL dump and getting the following error.
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 Is there anything else I should set? Just running |
|||||||||
|
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:
Also, change the my.cnf or my.ini file under the mysqld section and set:
or you could run these commands in a MySQL console connected to that same server:
(Use a very large value for the packet size.) |
|||||||||||||||||||||
|
As michaelpryor said, you have to change it for both the client and the daemon mysqld server. His solution for the client command-line is good, but the ini files don’t always do the trick, depending on configuration. So, open a terminal, type mysql to get a mysql prompt, and issue these commands:
Keep the mysql prompt open, and run your command-line SQL execution on a second terminal.. |
|||||||||||||||||||||
|
This can be changed in your
|
|||||||||||||
|
Re my.cnf on Mac OS X when using MySQL from the mysql.com dmg package distributionBy default, my.cnf is nowhere to be found. You need to copy one of |
|||||
|
Use a
|
|||||
|
Slightly unrelated to your problem, so here’s one for Google. If you didn’t mysqldump the SQL, it might be that your SQL is broken. I just got this error by accidentally having an unclosed string literal in my code. Sloppy fingers happen. That’s a fantastic error message to get for a runaway string, thanks for that MySQL! |
|||
On CENTOS 6 /etc/my.cnf , under [mysqld] section the correct syntax is:
|
|||
The fix is to increase the MySQL daemon’s max_allowed_packet. You can do this to a running daemon by logging in as Super and running the following commands.
Then to import your dump:
|
|||
In etc/my.cnf try changing the max_allowed _packet and net_buffer_length to
if this is not working then try changing to
|
|||
Set max_allowed_packet to the same (or more) than what it was when you dumped it with mysqldump. If you can’t do that, make the dump again with a smaller value. That is, assuming you dumped it with mysqldump. If you used some other tool, you’re on your own. |
|||||
|
I am working in a shared hosting environment and I have hosted a website based on Drupal. I cannot edit the So, I deleted all the tables which were related to Edit – Deleting the tables created problems for me, coz Drupal was expecting that these tables should be existing. So I emptied the contents of these tables which solved the problem. |
||||
protected by Community? Jan 8 ’12 at 20:13
Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.
Would you like to answer one of these unanswered questions instead?
Not the answer you’re looking for? Browse other questions tagged mysql or ask your own question.
转载请注明:(●--●) Hello.My Weicot » MySQL Error 1153 – Got a packet bigger than ‘max_allowed_packet’ bytes