I accidently removed root user from mysqld:

DROP USER 'root'@'localhost'; Query OK, 0 rows affected (0.00 sec)

Now I am unable to do anything (as expected), but I would like to understand the recovery steps. How to continue now, or am I doomed?

I've even followed the steps from another thread (I believe I've deleted MySQL root user, how do I recreate it?), but it doesn't work either

Basically I would like to know how to start afresh, if possible

  • What does "it doesn't work" mean? – blm Jan 18 '16 at 17:40
Stop MySQL service.
Run mysqld_safe --skip-grant-tables &
Type mysql -u root -p and press enter.
Enter your password.
At the mysql command line enter: use mysql;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.