At the time of installation of the website, it’s necessary to ascertain a reference to the database. The database stores all the information about your website like comments, posts, pages, etc. Not only stores data but also stores the changes that you simply make. It also provides the functionality to run and load your website. But sometimes at the time of creating a reference to the database, it shows an error.
There may be a couple of reasons why the error occurs.
Here, are some solutions given, using that you can run easily your website without connection errors.
The first easy way to solve a connection error is to check the database connection credential. For connecting with the database WordPress, it uses a specific username and password. at the time of changing the WordPress host or server, You must update your database connection details.
The database connection information is stored in your site’s “wp-config.php” file. in this file, you should check the above information.
– Database Username
– Database user password
– Database name
– Database hostname
Below is an example of your config file’s information that you simply need to check. Now we understand what are the data that ought to be checked and updated.
Update these three highlighted information that are available. For the finding these information, attend the your wordpress database phpMyAdmin and update from it.
After update don’t forget to save it and refresh your site using Ctl+F5. Your site runs perfectly.
The wordpress database could be a fairly complex thing, and there are lots of small cogs that require to remain working together perfectly to avoid trouble. At times, something goes out of place and that’s after you see the error establishing a database connection.
The first thing is to go to the WordPress dashboard – YOURSITE.COM/wp-admin
If you see the below error message then follow us for solving that.
Click on the repair database and let it do its thing. You can also repair it by adding the below line to end of the “config.php” file.
After that refresh your site and look, it runs successfully.
After applying the above steps, if your site not working then one final possibility is that your database server has gone down. At now, it’s an honest idea to verify together with your hosting provider that everything is functioning correctly.
there’s a spread of reasons why your database host or server can be experiencing issues:
At the last option solutions, you’ll also try these troubleshooting steps: