I am trying to set the max_connections parameter to /etc/my.cnf, but MariaDB does not seem to read the parameter from the file.
My file /etc/my.cnf:
[mysqld]
datadir=/data/mysql
socket=/data/mysql/mysql.sock
symbolic-links=0
connect_timeout = 60
wait_timeout = 28800
max_connections = 100000
max_allowed_packet = 64M
max_connect_errors = 1000
tmp_table_size = 512M
max_heap_table_size = 256M
table_cache = 512
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
[client]
port = 3306
socket= /data/mysql/mysql.sock
But when I check the variable in MariaDB, it shows the default value:
MariaDB [(none)]> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 214 |
+-----------------+-------+
1 row in set (0.00 sec)
However, the other options in my.cnf are correct:
MariaDB [(none)]> show variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.00 sec)
MariaDB [(none)]> show variables like 'max_allowed_packet';
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| max_allowed_packet | 67108864 |
+--------------------+----------+
1 row in set (0.00 sec)
MariaDB [(none)]> show variables like 'max_connect_errors';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| max_connect_errors | 1000 |
+--------------------+-------+
1 row in set (0.00 sec)
MariaDB [(none)]> show variables like 'connect_timeout';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| connect_timeout | 60 |
+-----------------+-------+
1 row in set (0.00 sec)
I can set this variable from the mysql command line, but it reloads when the service restarts:
MariaDB [(none)]> set global max_connections := 10000;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 10000 |
+-----------------+-------+
1 row in set (0.00 sec)
OS: RHEL 7
MariaDB Version: mariadb-server-5.5.47-1.el7_2.x86_64
See here: https://dba.stackexchange.com/questions/137487/mariadb-cannot-set-max-connections-and-wait-timeout-through-my-cnf
source
share