I too had faced the same issue many times but after refreshing the browser it solved my problem.
Kindly check the wp-config file and verify if the database name and other information is correct.
Another thing you can try is restarting your local host.
Related Posts:
- Get error messages when $wpdb->insert() returns false?
- Detecting errors generated by $wpdb->get_results()
- $wpdb->prepare() warning in WordPress 3.5
- Changing the Database Connection Error Message
- When importing database, it shows error
- Strange Deadlock database error for the query “Delete From wp_options”
- WordPress showing install screen after max_questions error
- What causes the “max_user_connections” warning on WordPress frontend?
- $wpdb variable throw this error Call to a member function get_results() on a non-object in
- Error establishing a database connection – with Debug Data
- error establishing a database connection
- Error: SELECT SQL_CALC_FOUND_ROWS
- Error establishing a database connection on Installation
- SQL Error wp_commentmeta – incorrect table definition
- Moving WP from local server to live, error establishing a db connection
- Where are WP_Errors Saved
- $wpdb doesn’t like to store arrays
- Error establishing database connection – high traffic?
- Catalina an MAMP Database Conenction Error
- Trouble Migrating all data blog from WordPress.com to WordPress.org
- How to fix database error duplicate entry
- Moving to another server database connection error [closed]
- “Error establishing a database connection” – Intermittent error on GoDaddy
- Problem in using wpdb
- How can I restrict php mail() to only send me one email after a db error
- Global__r connection timed out
- SELECT SQL_CALC_FOUND_ROWS with wordpress search
- Error establishing a database connection in wordpress site , website not opening
- How to get the full stack trace for WordPress “table doesn’t exist” error in debug.log?
- I imported an restore an database and It shows #1067 – Invalid default value for ‘user_registered’
- SQL database import #1046 error
- “wordpress error in establishing database connection” and missing tables
- error establishing database connection (WAMP + filezilla)
- Hang Up Followed By Can’t select database
- Database error after importing WordPress
- Catchable fatal error in formatting.php
- What am I doing wrong here? WordPress database error
- Restoring .sql backup results in “Error establishing a database connection”
- I broke database after reuploading local version – what exactly happened? Database error
- Print output of Table Creation
- Error at time of WordPress Installation
- WordPress database error Unknown column
- Getting an error when trying to migrate to DV server from Grid with Media Temple [closed]
- What is this JavaScript “require”?
- How can I make updates to a site, on a development copy, but then move updates back without overriding live site’s evolving database?
- How can I make a WordPress database portable and url independent?
- wpdb->insert multiple record at once
- How to migrate a HTTPS WordPress installation to localhost?
- How to stop WordPress using utf8mb4_unicode_520_ci collation?
- How to monitor server for error establishing a database connection
- WP_Options ID high
- Default WordPress settings API data sanitization
- Fatal error: Call to undefined function dbDelta()
- Connect to remote database using Localhost install
- remove missing image attachments
- How to ensure data consistency in WordPress
- How to intercept update_option() before it saves data?
- wpdb query on custom table not working [closed]
- Set Display Name to first and last name (phpmyadmin SQL Query)
- How to fix unchanged URLs in Database after running serialized search and replace script?
- wp_redirection_404 table has grown to 7GB
- WordPress database error – Error in SQL syntax – I can’t identify any error?
- Merging two wp_posts tables while avoiding duplicates
- Merging two databases without borking it
- How Yoast SEO plugin works with variable %%name%%?
- Move out of sync posts from one database to another
- MS Access to manage WordPress Database
- Query multiple tables at once?
- Custom WordPress Table wpdb
- $wpdb->get_results($wpdb->prepare(… You have an error in your SQL syntax;
- Transferring/Uploading Data from DB to WordPress
- how to encyrpt DB_PASSWORD in wp-config
- Choosing http or https during manual installation of WordPress and database
- Stringing together content from different databases
- Delete all posts that do NOT have a specific tag
- Changing order of db results when encoding to JSON
- Safely store code(html/js..) into database
- How do I debug an error that a plugin is causing?
- Why does wp_links still exist in the db schema?
- can’t upgrade wordpress or install plugins, it seems to “think” it’s still on a local installation
- How not to display ALL items of a database
- How to get the records from start with A to G in php and mysql
- Link multiple user databases together?
- Is there any defects for using same database prefix in WordPress for multiple sites?
- Can we store password in without being hashing?
- How to import products in host instead of database on wordpress?
- I would like some help wth an SQL query to link posts with categories
- Error establishing a database connection in wordpress
- Is there a way for two deferent themes to consume two different DB on a same WP instance?
- How to display $wpdb->insert_id; value on redirected page
- Should I Use only wpdb Class to Write Custom Queries?
- Auto populate form fields based on serial input or pull listings from other websites?
- How to extract some part of WordPress full source code
- Error establishing a database connection for some files
- Hash user emails in database?
- Database Name Change
- Weird characters in title if it contain “ ”
- Where To Find bb_profile_data(); In bbPress?
- One information repeated on multiple locations on one site [closed]
- Showing Error(TAble already exist)