All Collections
MySQL Databases
Database Troubleshooting
How to Fix the max_connections_per_hour MySQL Error
How to Fix the max_connections_per_hour MySQL Error

Solving max_connections_per_hour error

Updated over a week ago

If your website is hosted in Hostinger and you are receiving an error with max_connections_per_hour limit:

Connection failed: User 'u1000000_database' has exceeded the
'max_connections_per_hour' resource (current value: 500)

You can try the following:

Option 1 - Use Localhost

Make sure that the database hostname is set to the localhost in your website's configuration file, such as wp-config.php.

It is not recommended to set your database hostname to your hosting IP.

For example, if your current database configuration details are set up like this:

/** The name of the database for WordPress */
define( 'DB_NAME', 'u1000000_database' );
/** MySQL hostname */
define( 'DB_HOST', '185.185.185.185' );

Make sure to replace the last line value of DB_HOST to localhost as follows:

/** The name of the database for WordPress */
define( 'DB_NAME', 'u1000000_database' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

Option 2 - Stop the Processes

Some unoptimized code on your website can cause you to reach the max_user_connections limit. To solve it, you can terminate such connections manually by following these steps:

  1. Click SQL on the top menu, type SHOW PROCESSLIST and click GO:

  2. Once that's done, the list of current processes will be generated. You can stop each one by clicking on Stop the process:

Please note that stopping the processes will help only temporarily. For a more permanent solution, you will need to optimize your database queries or upgrade your plan 🚀

Did this answer your question?