1

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?

4
  • 2
    What do you mean unable to login? Your credentials are not accepted? Commented 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 present Commented Apr 14, 2017 at 19:15
  • Which MySQL Version, which OS, and which client ? Commented Apr 14, 2017 at 19:15
  • windows 10 mysql 5.7.7 using Wamp and workbench Commented Apr 14, 2017 at 19:16

1 Answer 1

0

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?

Sign up to request clarification or add additional context in comments.

14 Comments

I didint delete anything but how is it possible my passsword just stopped working
Ok so I checked mydata folder and they are still there which is a sigh of releif I think
Just need to reset your root password, and you should be able to get to them. In general, you'd want to create a new MySQL user that is specific to your application, so that you are not using root in production. You can do this by using: digitalocean.com/community/tutorials/…
I changed the directory and I now seem to have access to my databases and my password is the same as before I dont know what happend and how it changed but thank you.
Seriously thanks alot I have like 5 projects I was working on and thought it was all gone because before I didint udnerstand where databases files were even stored
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.