- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I restore the MySQL root user full privileges?
We can restore the MySQL root user full privileges with the help of UPDATE command.
Firstly, you need to stop mysqld and restart it with the --skip-grant-tables option. After that, connect to the mysqld server with only mysql (i.e. no -p option, and username may not be required).
Issue the below given command in the mysql client to restore the MySQL root user with full privileges.
mysql> UPDATE mysql.user SET Grant_priv = 'Y', Super_priv = 'Y' WHERE User = 'root'; Query OK, 0 rows affected (0.04 sec) Rows matched: 1 Changed: 0 Warnings: 0
Above, we have set super privilege.
Super_priv = 'Y'
Now we need to flush the privileges with the help of the FLUSH command.
mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.18 sec)
- How can we grant privileges to a MySQL user?
- How can we revoke privileges from a MySQL user?
- How to create MySQL user with limited privileges?
- How can I change root username in MySQL?
- How can I restore a file created by mysqldump?
- How can I restore a database dumped by mysqldump?
- MySQL new user access denied even after giving privileges?
- Check privileges (grants) for a specific user in MySQL?
- How can I resize the root window in Tkinter?
- Grant all privileges of a database to a MySQL user?
- What are the minimum MySQL user privileges to allow optimize and repair?
- How can I calculate full 24hour days between two specified dates in MySQL?
- How can I restore multiple databases or all databases dumped by mysqldump?
- How to check privileges in MySQL?
- How can we change MySQL user password by using the ALTER USER statement?