Database connections failing on localhost
-
Starting today my local WordPress sites will show “error establishing a database connection” I am using WAMP. PHPmyadmin will load the login screen but it won’t accept my password. Localhost will load the Wamp page. Any ideas what I can do to fix this?
-
First, go to your WAMP control panel and reset the MySQL root password. If you receive an error when resetting the password, it means your MySQL master user database is corrupted, and you will probably need to re-install WAMP. But first, let’s see whether your current root user credentials work.
Next, use your WAMP control panel to access the MySQL console. Use the new root password, or if the password reset failed, use the old root password. If you are able to access the console and get a mysql> prompt, type quit to leave the console, and then attempt to log in to phpMyAdmin using the root user and password.
If you cannot access the MySQL console, then your MySQL installation is corrupted, and it is unlikely you will be able to save your databases. If your database was large/important, you might want to consider posting a question on a MySQL support forum concerning data recovery methods.
If you were able to access the MySQL console, then log into phpMyAdmin with the root user/password and export your database(s). Make sure you export them to a different logical drive, or if you have not created logical drives, then export the database(s) to an external backup drive. A USB thumb drive would be fine.
If the root user password could not be reset but you were able to export your database(s), you should now re-install WAMP, and then you can use phpMyAdmin to import the database(s) you just exported.
If you could reset the root user password above, click the Users tab in phpMyAdmin, and attampt to change the password of the user that is accessing the WordPress database. If that is successful, your problem should be solved.
Thanks for the information. I got you message after I trying many things and what got me in was turning off password requirement for phpMyadmin. Then once I got logged in all my databases were gone but one. I have no idea how all this happened. At first I updated WordPress on one of my local sites. Everything was fine. Then I tried fixing the issue where the wamp icon would not change from orange to green. So a combination of changing files and logging in with command line changing the password and flushing privileges screwed it up. I also had an early install of MySQL and I removed that. Lucky none of my files were deleted. I removed MySQL and Wamp. Reinstalled and imported a database from the online version.
Any idea why the login would get corrupted like this? Does if have to do with not shutting down or logging out?
Logging in without a password will only show you the information_schema database. My guess is that your databases were still there before you did the re-install. Oh well…
When will I receive an email to start import? I was given the below information and so far haven’t received any emails to import data that was stored on hosted site.
Started an export at the site below, they say an email will be sent to goodystoys@goodystoys.com once it is complete. You can use it to import when they send the link
Who is this user above? Moderators please remove. Thanks.
Both overt and covert spamming has become a problem here in the past few months. I just made a post that called out one such “covert” person whose posts typically range in usefulness between worthless and dangerous.
This support site should be using real discussion board software. bbPress is not in that category. There, I said it. π
Thanks for your help. Maybe the data was there. From what recover there was only one of my four databases. I didn’t bother trying to recover it any other way but know I know. Strange it happened and also that it didn’t delete them all.
Where is the WAMP control panel?
I meant MAMP control panel.
I need to know if I need to re-install MAMP.
The topic ‘Database connections failing on localhost’ is closed to new replies.