If theres any incorrect database information in the WordPress database server or settings then you might encounter error establishing database connection. Yes, there are a number of solutions following which you can rectify this error immediately.
·Checking of the database host information: The first thing that you can do is checking that you are using the correct database host information.
·Checking of the WordPress Database Credentials: Sometimes, incorrect database credentials can make you witness this error. So check the credentials of the WordPress database. Also, check if your database server is not down.
·If these solutions dont work then you can also update the WordPress site URL with the help of phpMyAdmin.
·One of the solutions that you can try is rebooting the web servers. Whether it is a local server or VPS, you can try rebooting it.