Error establishing a database connection
-
I have an installation of WP3.8 hosted online that I have made a copy of and installed locally, to continue working on it offline and to be uploaded and update the online version once completed.
Upon accessing the site I get the infamous: Error establishing a database connection.
I have tried the following:
Checked the parameters in wp-config.php – These correct.
Modified the urls “siteurl” and “home” fields in the wp_options table in the WP database. – These are correct.
Modified .htaccess in the localhost/wordpress folder and modified the RewriteBase /wordpress statement.
Checked the above several times for possible spelling errors.
Checked the connection to the database is working by using a testconnection.php script. The script works and reports successful connection. This also confirms that the dbhost, dbuser, and dbpassword are correct.
Checked the MySQL server is working – confirmed
Checked MySQL error log – no errors
Checked the Appache server is working – confirmed
Checked Appache error log – no errors
Checked PHP error log – no errors
Checked the database using phpMyAdmin – confirmed and Repaired
Tried to repair the database with the repair.php script in localhost/wordpress/wp-admin/maint – the script reports the database connection error
Tried to access the localhost/wordpress/wp-admin – it reports the following:Error establishing a database connection
If your site does not display, please contact the owner of this network. If you are the owner of this network please check that MySQL is running properly and all tables are error free.Could not find site localhost/wordpress. Searched for table wp_blogs in database wpdb. Is that right?
What do I do now? Read the bug report page. Some of the guidelines there may help you figure out what went wrong. If you’re still stuck with this message, then check that your database contains the following tables:
wp_users
wp_usermeta
wp_blogs
wp_signups
wp_site
wp_sitemeta
wp_registration_log
wp_blog_versionsVerified if wp_blog exists – confirmed.
Checked the bug report page Other lessor known issues:
Checked root (MySQL user) has all privileges to the wp database – confirmedI would greatly appreciate any assistance in resolving this. Thank you in advance.
- The topic ‘Error establishing a database connection’ is closed to new replies.