By rajsingh67
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)
…
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Regards, Rajkishore
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.