简体   繁体   中英

Error Code: 1044. Access denied for user

While logging into MySQL using 'root'@10.0.1.15'

I tried to grant a user SELECT, INSERT, UPDATE but got this error from MySQL

Error Code: 1044. Access denied for user 'root'@'10.%' to database 'abc'

This is the query that I used to grant

GRANT SELECT, INSERT, UPDATE ON abc.* TO 'myUser'@'10.%';

This makes no since because when I execute SHOW GRANTS FOR 'root'@'10.%' Here is what I get

GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.%' IDENTIFIED BY PASSWORD 'jklasdfksfkashdfksdfhsdlkfasdfjklasdfsjk'

I tried to do grant all privileges all over again but still getting the same error.

GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.%';
FLUSH PRIVILEGES;

What I could be doing wrong here? why aren't the user 'root'@'10.0.1.15' able to GRANT other users privileges?

Your user needs the GRANT OPTION .

Here's how to change your existing grant to fix that:

GRANT ALL PRIVILEGES ON *.* 
TO 'root'@'10.%' 
IDENTIFIED BY PASSWORD 'jklasdfksfkashdfksdfhsdlkfasdfjklasdfsjk' 
WITH GRANT OPTION

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM