David542
David542

Reputation: 110173

Difficulty changing max_allowed_packet in mysql

I am trying to change the max_allowed_packet=20M. This is that I've done:

$ mysql -u root -e 'show variables like "max%"'

+----------------------------+----------------------+
| Variable_name              | Value                |
+----------------------------+----------------------+
| max_allowed_packet         | 16777216             |

$ sudo vim /etc/my.cnf

# my.cnf
[mysqld]
max_allowed_packet=20M

$ sudo service mysql restart

$ mysql -u root -e 'show variables like "max%"'

+----------------------------+----------------------+
| Variable_name              | Value                |
+----------------------------+----------------------+
| max_allowed_packet         | 16777216             |

Why is nothing changing here? What do I need to do to actually change this setting? (Note that I am using ec2 here).

Upvotes: 1

Views: 903

Answers (2)

Vikas Baru
Vikas Baru

Reputation: 162

Your restart query is incorrect. It should be:

$ sudo service mysqld restart

You missed "d" in mysqld

Upvotes: 0

Ross Smith II
Ross Smith II

Reputation: 12179

Try

[mysqld]
max-allowed-packet=20M

instead.

Computer can be SO picky!

Upvotes: 1

Related Questions