1

I had mysql already installed in my system and I uninstalled it because it was not running successfully. Now when I installed a new version of mysql, the server starts and stops successfully. But it still accepts the password of my old mysql. If I try to change the password, which I need to because it says my old password has expired when I try to connect it to workbench, it gives me the following error:

File './mysql/user.MYD' not found (Errcode: 2 - No such file or directory)

I also tried running this command:

 mysql -uroot -p

It accepts my old password and then if I further run any other command, example

mysql> USE mysql;

It asks me to reset the password and when I do it again gives me the above error

2
  • Do the answers from this previous question help? stackoverflow.com/questions/33467337/… Commented May 16, 2017 at 16:07
  • yes I tried this, it still gives me the same error Commented May 16, 2017 at 16:25

1 Answer 1

2

If you've trashed your MySQL system tables you'll need to recreate them with the mysql_install_db command-line tool or something equivalent. This is done while the server process is stopped and should initialize everything correctly.

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

3 Comments

I tried mysqld --initialize. It says: [ERROR] --initialize specified but the data directory has files in it. Aborting.
You might need to manually purge any left-over bits from your previous install.
I removed all the left overs and reinstalled mysql and it works :D There was some file which had not been deleted

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.