While trying to navigate or learn more about users in mysql phpmyadmin I accidentally removed the PRIVILEGES of the user root. Now i cant create new database, new user, etc. How can I restore the PRIVILEGES to user root again
- What I wanted to do when I made my mistake is to create a sole user for one of my database.I wanted to remove the PRIVILEGES of root for that specific database only and not for everything. It seems that I remove the PRIVILEGES of root for the entire mysql.
Tried
USE mysql;
UPDATE user SET Grant_priv='1' WHERE User='root';
FLUSH PRIVILEGES;
Getting
Error SQL query:
USE mysql;
MySQL said: Documentation
1044 - Access denied for user 'root'@'localhost' to database 'mysql'
Tried
UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root';
FLUSH PRIVILEGES;
GRANT ALL ON *.* TO 'root'@'localhost';
Getting
Error SQL query:
UPDATE mysql.user SET Grant_priv = 'Y', Super_priv = 'Y' WHERE User = 'root';
MySQL said: Documentation
1142 - UPDATE command denied to user 'root'@'localhost' for table 'user'
UPDATE
I tried creating new user
CREATE USER 'user'@'localhost' IDENTIFIED BY 'user';
and i get this error
1227 - Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
tried
GRANT ALL PRIVILEGES ON * . * TO 'root'@'localhost' IDENTIFIED BY 'qwe';
getting
1045 - Access denied for user 'root'@'localhost' (using password: YES)
Any idea is appreciated.