1

I want to change max_connections via /etc/my.cnf but it seems to not work.

mysql> select variable_name, variable_value
       from global_variables
       where variable_name = 'max_connections';

+-----------------+----------------+
| variable_name   | variable_value |
+-----------------+----------------+
| MAX_CONNECTIONS | 300            |
+-----------------+----------------+

After restarting ...

$ sudo /usr/local/mysql/support-files/mysql.server restart
Shutting down MySQL
.... SUCCESS!
Starting MySQL
.. SUCCESS!

With this configuration file.

$ cat /etc/my.cnf
[mysqld]
max_connections=500

I still get 300.

This is my mysql version:

mysql  Ver 14.14 Distrib 5.6.15, for osx10.7 (i386) using  EditLine wrapper

Edit (1):

Typing "$ mysql --help | grep Default -A 1" I can get

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf

But I've only /etc/my.cnf

Edit (with solution) (2):

With "$ locate my.cnf" I can see that my configuration file to edit must be /usr/local/mysql-5.6.15-osx10.7-x86/my.cnf Modifing max_connections in this file I succesfully obtain 500 as MAX_CONNECTION value

mysql> select variable_name, variable_value
       from global_variables
       where variable_name = 'max_connections';

+-----------------+----------------+
| variable_name   | variable_value |
+-----------------+----------------+
| MAX_CONNECTIONS | 500            |
+-----------------+----------------+
sensorario
  • 20,262
  • 30
  • 97
  • 159
  • 1
    Are you _sure_ that `/etc/my.cnf` is the config file in use? Could you [please check that](http://stackoverflow.com/questions/3270326/how-to-find-out-the-location-of-currently-used-mysql-configuration-file-in-linux)? – Carsten May 19 '14 at 09:06
  • I am sure because if I remove (for example) "[mysqld]" restarting I get an error. – sensorario May 19 '14 at 09:07

0 Answers0