Home > database >  There was a ERROR 1064 to create a new user, where there is a problem?
There was a ERROR 1064 to create a new user, where there is a problem?

Time:12-21

Looking at Tom and Java Web development technology, the eighth chapter, this chapter beginning requirements to create a new user in the MySQL database, steps are as follows:
(1) on the command line window input: mysql -u root -p,
(2) the system prompted for a password and then enter the MySQL root password,
(3) into a mysql database, use the following statement to create a user name and password, respectively dbuser and 1234 new users:
The use of mysql;

Grant all privileges on *. * to dbuser @ localhost
Identified by the '1234' with grant option;

Perform step (3) after the last line of the error, the error information is as follows:
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' 1234 'with grant option' at line 2

CodePudding user response:

See version, if Mysql 8.0 + has been unable to use this method to add user

Should the create user dbuser @ localhost identified by '1234'.
Grant all privileges on *. * to dbuser @ localhost with grant option;
  • Related