So you may have have come across database troubles on your website creating journey?
A common one might be:
This normally displays when a WordPress website has incorrect database configuration or the connection cannot be made to the backend server *(rate limiting) frozen database.*
You can simply wait this error out if you confirm it is indeedrate limiting.
Waiting these issues out is all you can do, we can’t speed up the process ofrate limiting, you can upgrade to Hostinger Premium where there aren’t limits in place and you won’t face these issues.
First thing to do would be to login to the 000webhost panel and hit Tools then Database Manager, see your active WordPress database then, Manage and phpMyAdmin.
If you successfully manage to load up and login to phpMyAdmin without any error messages - your database is active and NOT rate limited, so there is just a simple script configuration issue.
You will see this screen below / your phpMyAdmin won’t login or load at all if you are being limited
If you successfully manage to load into your phpMyAdmin, then you just need to head into the File Manager, open public_html folder then then file called wp-config.php.
Browse down until you see the values of database name, username, password and hostname.
Make sure these values match EXACTLY as within Database Manager on 000webhost.com - if you are unsure then simply copy the password from wp-config.php and use it to set the password on Database Manager just to confirm.
If you continue to get this error then there may be some other configuration in wp-config.php needing tweaked or it is possible some core files / theme / plugin is affecting the connection - you’d be alright to open a thread and we can possibly investigate / help you with this.
A very basic wp-config.php file that you can use to fill in your values would be
<?php
/* MySQL settings */
define( 'DB_NAME', 'database_name_here' );
define( 'DB_USER', 'username_here' );
define( 'DB_PASSWORD', 'password_here' );
define( 'DB_HOST', 'localhost' );
define( 'DB_CHARSET', 'utf8mb4' );
/* MySQL database table prefix. */
$table_prefix = 'wp_';
/* Authentication Unique Keys and Salts. */
/* https://api.wordpress.org/secret-key/1.1/salt/ */
define( 'AUTH_KEY', 'put your unique phrase here' );
define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
define( 'NONCE_KEY', 'put your unique phrase here' );
define( 'AUTH_SALT', 'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
define( 'NONCE_SALT', 'put your unique phrase here' );
/* Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/* Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
Obviously the table prefix might need changing and you’ll need to generate the keys/salts via
https://api.wordpress.org/secret-key/1.1/salt/
If you are using any other script that relies on database and you get similar database connection errors, make sure the hostname, username, database name and password match exactly for the connection to work properly.
Remember the hostname on the free plan is always just localhost
You can make a test file named connect-test.php on your file manager in the public_html folder
Using the code below change the username, database name and password then save it.
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$database = "database";
try {
$conn = new PDO("mysql:host=$servername;dbname=$database", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
} catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}
?>
Once you’ve saved this visit the page in the browser and fingers crossed you see Connected successfully, if this appears then you’ve got valid credentials and any issues with your script will likely relate to the code itself which you can obtain documentation via the developer/script author.
If you see Connection failed, you need to make sure you’ve got phpMyAdmin access - if you do and it works then again validate and make sure the password, username and database name + hostname is correct.
If your phpMyAdmin doesn’t load up - it could be you are being rate limited or there is database node issues.
Waiting these issues out is all you can do, we can’t speed up the process of rate limiting, you can upgrade to Hostinger Premium where there aren’t limits in place and you won’t face these issues.
You can test connection for scripts using PDO, MYSQLI, MYSQLI_CONNECT
See that thread for more information.