MySQL Forums
Forum List  »  General

Re: Access denied for user 'root'@'localhost' (using password: YES)
Posted by: Karen Goh
Date: May 27, 2021 07:43AM

Hi Peter,

Please find attached that I am able to log into workbench using the same user - root and password.


https://ibb.co/xjh96bd

And today, I attempted to do this below but still I can the same denial of access.

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '%password%' WITH GRANT OPTION;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY '%password%' WITH GRANT OPTION' at line 1
mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'password';
ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'mypass';
ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'mypass';
ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'mypass' WITH GRANT OPTION;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'mypass' WITH GRANT OPTION' at line 1
mysql> GRANT ALL PRIVILEGES ON *.cfe TO 'root'@'%' IDENTIFIED BY 'mypass';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cfe TO 'root'@'%' IDENTIFIED BY 'mypass'' at line 1
mysql> ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cfe TO 'root'@'%' IDENTIFIED BY 'mypass'' at line 1
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ERROR 1064 (42000): You have an error in your SQL syntax' at line 1
-> grant all privileges on springoidc.* to 'root'@'127.0.0.1' identified by 'mypass';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'the manual that corresponds to your MySQL server version for the right syntax to' at line 1
mysql> grant all privileges on springoidc.* to 'root'@'localhost' identified by 'mypass';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'mypass'' at line 1
mysql>

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.