I updated the file /etc/mysql/mysql.conf.d/mysqld.cnf to include line max_connections = 65535. I restarted the MySQL server with sudo service mysql restart. Then in the MySQL client I entered the command SHOW VARIABLES LIKE 'max_connections'; and got the following output:
+-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 9190 | +-----------------+-------+ 1 row in set (0.00 sec) I tried this on my desktop and on my dedicated server both running Ubuntu 20.04 LTS. I got the exact same results on both boxes.
What's going on? Why isn't the new max_connections value 65535?
1 Answer
To manage a connection , you need a file descriptor .
The max-connections will be constraint by the max open files .
So check the value of open_files_limit
show global variables like '%open_files_limit%' ; To change the value of open_files_limit to 20000 by example you must
1) run the command systemctl edit mysql and this
[Service] LimitNOFILE=20000 2) systemctl stop mysql
3) systemctl start mysql