Recreate the root user in Mysql

Asked

Viewed 32 times

-2

I made the stupidity of DELETE the root user of my Mysql. I’ve done everything, uninstalled and reinstalled, but nothing works.

At the moment I am creating a virtual machine to use, because I have school tasks to deliver using Java in Eclipse, but in the long run this does not help me.

How can I recreate the user root in Mysql?

  • Support issues are not in scope (and would duplicate at the time it was accepted), but the solution is simple; call the executable with the flag --skip-grant-tables which you access with any user and password (or empty). Here it goes in the user table and creates a superuser (no need to call root, can for a less manly name) - Then restarts the server without the --skip-grant-tables and test. The flag simply causes the server to disregard authentication. Just don’t forget to remove the boot after (and obviously don’t with the server exposed on the internet).

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.