Solve the warning: connect to mysql server 127.0.0.1: Too many connections

If you get the error message "connect to mysql server 127.0.0.1: Too many connections" in a log file, e.g. the mail.log file, then the max. number of mysql database connections on your server is reached. To increase the max. number of simultanious connections, edit the MySQL my.cnf file:

vi /etc/mysql/my.cnf

and add or change the lines for mysql max_connections and max_user_connections in the [mysqld] section of the my.cnf file:

[mysqld]
......
max_connections = 500
max_user_connections = 500
.......

facebooktwittergoogle_plusredditlinkedinmail

One thought on “Solve the warning: connect to mysql server 127.0.0.1: Too many connections”

  1. You can also run
    SET GLOBAL max_connections = 500;
    in the mysql cli if you don’t want to restart your server.
    Ofcourse you sill need it added to my.cnf so its used on the next restart.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>