MySQL server is currently offline. Error: Too many connections at /usr/local/cpanel/Cpanel/Mysql.pm line 173.

phpMyAdmin and MySQL Databases in cPanel were displaying me the below error -
==============================================================
The MySQL server is currently offline.

Error while connecting to MySQL: (XID 98u48v) Database Connect Error: Too many connections Error while connecting to MySQL: (XID 98u48v) Database Connect Error: Too many connections at /usr/local/cpanel/Cpanel/Mysql.pm line 173.

==============================================================
Sites on server were down with error as - Error establishing a database connection
==============================================================

Necessary Checks :-

1. Check the status of MySQL service -
    service mysql status
    Output - SUCCESS! MySQL running (515897)
    MySQL service was running without any issue.

 2. Check the current MySQL processes on server -
     mysqladmin pr
     Output - mysqladmin: connect to server at 'localhost' failed 
     error: 'Too many connections'
     That means your server has exceeded the limit of handling the MySQL connection.

Solutions :-

1. You can kill the current running MySQL processes forcefully using -
1. mysqladmin pr ------------------> It will list the current running process.
2. kill process id --------------------> Kill the current processes using their ID.

Below is the example for you -

If you'll fire 'mysqladmin pr' then output will be as follow -
-------------------------------------------------------------------------------------+-------------------------
| Id | User | Host | db | Command | Time | State | Info +--------+------------------+-----------+-------------------+---------+------+----------------+----------
539054 | user_name | localhost |user_name | Sleep | 2 | |
-------------------------------------------------------------------------------------+-------------------------
If you'd like to kill process '539054' then fire - kill 539054

Still you're facing the same issue then move to step 2.

2. Update the maximum number of connection allowed on server. Default value is set to 151, you can update according your server capability.

1. Edit my.cnf file on location - /etc/my.cnf or /etc/mysql/my.cnf
2. Update the maximum number of connectionmax_connections=xxx ------> Replace xxx value as per your need
3. Restart the MySQL service - /etc/init.d/mysql restart OR service mysql restart

It resolved my issue!

Was this answer helpful?

 Print this Article

Also Read

The mail server could not deliver mail to mailadress@gmail.com. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.

All of sudden emails are getting bounced with below bounce back messages on the cPanel server as...

How to configure Amazon S3 backups in WHM?

There is always issues on the server like Hard Drive Failures and its very important to keep your...

DenyIp::adddenyip(xxx.xxx.xxx.xxx) failed: Error: while opening /home/xxx/public_html/.htaccess Error: while opening /home/xxx/public_html/.htaccess

I was getting the below error while adding an IP address from cPanel >> IP Blocker...

How to Re-arrange accounts in WHM?

Please go through the following steps on How to Re-arrange accounts in WHM 1. Go to WHM and...

The following errors were found : Drupal not upgrading using Softaculous

While upgrading the Drupal from 8.19 to 8.21 from cPanel >> Softaculous Application...

Powered by WHMCompleteSolution