增加mysql导入大小 [英] Increasing mysql import size

查看:109
本文介绍了增加mysql导入大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将mysql文件导入到我的cpanel phpmyadmin中.但是我收到此错误消息. #1153-收到了一个大于'max_allowed_pa​​cket'个字节的数据包"

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"

我也尝试过腻子.但是错误消息是相同的.我不知道如何在cpanel中的mysql中更改mox上传大小.

I have tried putty as well. But the error message is same. I don't know how to change the mox upload size in mysql in cpanel.

请帮助我

非常感谢您

推荐答案

此错误与php.ini无关,它显然是来自DBMS的错误消息.

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

您可以在my.cnf文件中增加max_allowed_pa​​cket的值:

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

[mysqld]
max_allowed_packet = 128M

重新启动mysqld后,它应该可以工作(对于更大的数据,请增加该值)

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

如果您尝试用腻子导入",我想您是从命令行使用mysql的,在这种情况下,您可以使用--max_allowed_pa​​cket参数启动mysql,例如:

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

或者,如果您从正在运行的mysql会话中获取文件,则可以通过以下方式设置参数:

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

set global max_allowed_packet=128M;

最后一个示例仅在下一次重新启动mysqld之前有效,因为永久解决方案请遵循我的第一个示例.

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

这篇关于增加mysql导入大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆