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)

Try these things:

Option 1 - Use Localhost

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

We don't recommend setting your database hostname to server IP.

Example (incorrect):

/** The name of the database for WordPress */

define( 'DB_NAME', 'u1000000_database' );

/** MySQL hostname */

define( 'DB_HOST', '104.20.160.69' );

Example (correct):

/** 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 max_user_connections limits. To solve this you can terminate such connections manually as guided here:

  • Open your database via phpMyAdmin

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

  • Once that's done you will see the list of current processes, you can stop it by clicking on Stop the process:

It's worth noting that this option only helps temporarily, to solve such issues for good, you would need to optimize your database queries or upgrade your plan.

NOTE:

Did this answer your question?