|
Mysqli_error()); } echo 'Connected successfully'; mysqli_close($link); ?> If necessary, do not hesitate to contact the support of the company responsible for hosting. If the service is of good quality, you will be quickly assisted and directed towards correcting the error. Verify credentials As we already mentioned, if your credentials are incorrect or outdated, WordPress will not be able to connect to the MySQL database, generating the error in question. So if you find that the server is not the problem, check that the database login information matches what was recorded in the wp-config.php file .
Doing this is not difficult, you can use a specific plugin Telegram Number Data or simply enter the WordPress file manager. Then go to the /public_html/ page, find the wp-config.php file and use the right mouse button to access the configuration options. Then, simply click “ Edit ”, as indicated in the image below. Error establishing a database connection Source : Hostinger Your purpose is to find and record the following lines of code: ADVERTISEMENT // ** MySQL settings - You can get this info from your web host 'DB_HOST', 'localhost' ); See what each of the elements means: DB_NAME: database name; DB_USER: username; DB_PASSWORD: access password; DB_HOST – The host of the database.
Write down the information found and return to your MySQL database to compare it with the registered credentials. You will come across a page that looks like this: Error establishing a database connection Source : WPBeginner If you notice that the data does not match, your problem is almost solved. To make the necessary changes, edit the following lines in the wp-config.php file: define('DB_NAME', 'fill_this_with_your_current_database_name'); define('DB_USER', 'fill_this_with_your_current_username') ; ADVERTISEMENT define('DB_HOST', 'fill_this_with_your_current_localhost'); If after confirming that the credentials are correct, the problem still persists, you should explore other methods.
|
|