Fix Error establishing a database connection in WordPress | Also Repair & Optimize Database | 2021
WordPress database error: If you have faced a database connection error then this video tutorial is here to save you. Error establishing database connection is mainly due to a mistake in the database name, username, or password. If you can fix these then your website will work all good. This video gives you step-by-step instructions on how you can resolve this.
In addition to this, you will also learn how you can repair and optimize the database with a link and a small code addition to the wp-config.php file. You will NOT REQUIRE any plugins to do so and it will work all great.
Hope this video tutorial saves you and fixes the connection error.