Question

lost privileges to root via mysql workbench...please help, site down

Please help!..

I am facing a huge problem…i had access to database through MySQL workbench but one of my coworkers accidentally went on to users and privileges and revoke them…he thought he was deleting another user.

Now I can’t access my information schema on mysql workbench and all my privileges are gone…i am logging through root…also my website is down becaause there are no other users…i am able to login to mysql via mysql -h 127.0.0.1 -u root but i can’t seem to add or get my privileges back…

mysql> show grants for ‘root’; ERROR 1141 (42000): There is no such grant defined for user ‘root’ on host ‘%’ mysql> SHOW GRANTS FOR ‘root’@‘localhost’; ±-------------------------------------------------------------+ | Grants for root@localhost | ±-------------------------------------------------------------+ | GRANT USAGE ON . TO ‘root’@‘localhost’ | | GRANT PROXY ON ‘’@‘’ TO ‘root’@‘localhost’ WITH GRANT OPTION | ±-------------------------------------------------------------+ 2 rows in set (0.00 sec)

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @rajsingh67,

Since your database user has been deleted accidentally and now you are left with only MySQL root user, You can follow the below link to create a new MySQL user again with the same privilege you had earlier.

https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql

Regards, Rajkishore