I have been working on my first project using databases using MySQL. I woke up this morning unable to login to localhost. I am able to enter root with no password and none of my databases are there. What should I do?
-
2What do you mean unable to login? Your credentials are not accepted?BenM– BenM2017-04-14 19:14:56 +00:00Commented Apr 14, 2017 at 19:14
-
yes It says acess denied and when i tried to login without a password it works but no databases are presentlolsharp– lolsharp2017-04-14 19:15:46 +00:00Commented Apr 14, 2017 at 19:15
-
Which MySQL Version, which OS, and which client ?Bernd Buffen– Bernd Buffen2017-04-14 19:15:50 +00:00Commented Apr 14, 2017 at 19:15
-
windows 10 mysql 5.7.7 using Wamp and workbenchlolsharp– lolsharp2017-04-14 19:16:38 +00:00Commented Apr 14, 2017 at 19:16
1 Answer
In theory root should have access to all your databases. If you haven't deleted them, it's possible you just lost access to them. Remember that MySQL is host-sensitive when logging in.
root@%,root@localhost, [email protected], etc... all may be assigned different permissions.
You can try skip-grant-table in my.ini, as explained in this answer:
Regaining access to lost MySQL password for PHPMyAdmin on WAMP
With this you can reset the root password and try again.
If this does not yield effect, I would look into your SQL history and see if you haven't accidentally deleted them?
14 Comments
root in production. You can do this by using: digitalocean.com/community/tutorials/…