Wednesday, June 2, 2021

Set max connections on mariadb

  1. Update the my.cnf file, so that the new value is used if the MySQL/MariaDB server is restarted.
  2. Use the SET GLOBAL command to update the value on the running MySQL/MariaDB server.

Fortunately, by using this method, you will not need to restart MySQL/MariaDB, and therefore will not need to experience any downtime.


In /etc/my.cnf

[mysqld]

max_connections=300

 



mysql -u root -p

Set the new max_connections value with the command:


SET GLOBAL max_connections=[desired new maximum number];

For example, to set max_connections to 200, the command is:


SET GLOBAL max_connections=200;



No comments:

Post a Comment