ERROR 1153 (08S01) at line 3802: Got a packet bigger than 'max_allowed_packet' by tes
當上傳的.sql檔案過大,
受MYSQL參數max_allowed_packet(預設為1048576K)的限制,所以會產生上面的錯誤訊息。
(1G = 1*1024*1024K)

【方法一】失敗?

編輯my.cnf(windows下my.ini)
在[mysqld]的地方加入以下設定
max_allowed_packet = 20M
之後重新啟動阿帕契
有誰用這個方法成功的可以教我一下嘛?
我設定完怎麼 max_allowed_packet還是預設值? 

[root@business ilona]# mysql -u root
mysql> show variables like "max_allowed_packet";
+--------------------+---------+
| Variable_name | Value |
+--------------------+---------+
| max_allowed_packet | 1048576 |
+--------------------+---------+
1 row in set (0.00 sec)

[root@business ilona]# locate my.cnf
/etc/my.cnf (或是mysql --help | grep my.cnf)
[root@business ilona]# vim /etc/my.cnf

在[mysqld]的地方加入以下設定
max_allowed_packet = 20M
設定好後存檔 

[root@business ilona]# /etc/rc.d/init.d/httpd restart

 


【方法二】成功!

mysql> set global max_allowed_packet = 2*1024*1024*10;
Query OK, 0 rows affected (0.00 sec)
[root@business ilona]# /etc/rc.d/init.d/httpd stop
Stopping httpd: [ OK ]
[root@business ilona]# /etc/rc.d/init.d/httpd start
Starting httpd: [ OK ]
[root@business ilona]# mysql -u root -p
Enter password:
mysql> show variables like "max_allowed_packet";
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| max_allowed_packet | 20971520 |
+--------------------+----------+
1 row in set (0.00 sec)

 

------------------------------------

小字:
其實是再搬移Druapl的SQL資料時發生的問題
以為是自己沒有cache clear

清掉發現 還是傳不過去冏
資料怎麼默默的變這麼胖了............(茶)

 

cabuchi 發表在 痞客邦 PIXNET 留言(0) 人氣()