3

I've created a my.cnf file and placed it according to this question. I've logged in to mysql as root and SET GLOBAL max_allowed_packet=536870912. I've restarted MAMP. I keep getting this:

mysql> show variables like 'max_allowed_packet';
+--------------------+----------+
| Variable_name      | Value    |
+--------------------+----------+
| max_allowed_packet | 16777216 |
+--------------------+----------+
1 row in set (0.00 sec)

BTW,

$ which mysql
/Applications/MAMP/Library/bin/mysql

and

$ mysql --help | grep cnf
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /Applications/MAMP/conf/my.cnf ~/.my.cnf 

and MySQL config info

Why won't it change? What else can I try?

Community
  • 1
  • 1
beth
  • 1,916
  • 4
  • 23
  • 39

3 Answers3

7

If you have MAMP set up to administer MySQL with phpMyAdmin then you can change this via the "Variables" tab in phpMyAdmin.

This was the only method which worked for me, trying to set it any other way would cause it to reset to 16M whenever I'd restart MySQL.

CodeShaman
  • 2,131
  • 2
  • 19
  • 34
1

you can use phpmyadmin SQL query(s) view - show variables like 'max_allowed_packet' set - set global max_allowed_packet=33554432

oleg
  • 21
  • 1
-1

If you change a global system variable, the value is remembered and used for new connections until the server restarts.

Thats from MySQL docs. Therefore you should add the line max_allowed_packet=536870912 to my.cnf file under [mysqld] section (docs).

vadchen
  • 1,442
  • 1
  • 11
  • 14