When I tried to grant privileges on users at mySQL, the error happened.Am I type something wrong on the command line?
mySQL Ver 8.0.16 for macos10.14 on x86_64 (MySQL Community Server - GPL).
mysql>grant all privileges on librarydb.* to 'phill'@'%' identified by '123456';
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 '123456'' at line 1.
The next command
mysql>grant all privileges on librarydb.* to 'phill'@'%' identified by '123456';
Should be changed to:
mysql> create user 'phill' identified by '123456';
mysql> grant all privileges on librarydb.* to 'phill';
if the 'phill' user have not been created yet. If it have been created earlier, then use alter
instead of create
What version is your MySQL? If it's 5.7 or later, maybe same as this question:
Unsuccessfully granting privileges
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With