Error Code: 1064. 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 ‘11111” at line 1;
会报错的写法:
CREATE USER ‘w’@’localhost’ IDENTIFIED BY ‘000000’;
GRANT ALL PRIVILEGES
ON .
TO ‘w’@’localhost’
IDENTIFIED BY ‘000000’;
以下是正确的写法:
create user ‘tom’@’localhost’ identified by ‘123123’;
grant all privileges on . to ‘tom’@’localhost’ ;
可见,在授权的语句中需要去掉
IDENTIFIED BY ‘password’;
单独授予某种权限的写法:
GRANT SELECT
ON oilsystem.input
TO ‘u5’@’localhost’
刷新权限并查看权限的写法:
FLUSH PRIVILEGES;
select * from user;
注意:在创建用户前需要加一句
Use mysql;