我遇到错误一: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;我遇到的错误二:Error Code: 1396. Operation CREATE USER failed for ‘u10’@’localhost’
会报错的写法:
CREATE USER ‘w’@’localhost’ IDENTIFIED BY ‘000000’;
GRANT ALL PRIVILEGES
ON .
TO ‘w’@’localhost’
IDENTIFIED BY ‘000000’;mysql
如下是正确的写法:web
create user ‘tom’@’localhost’ identified by ‘123123’;
grant all privileges on . to ‘tom’@’localhost’ ;sql
可见,在受权的语句中须要去掉
IDENTIFIED BY ‘password’;ide
单独授予某种权限的写法:
GRANT SELECT
ON oilsystem.input
TO ‘u5’@’localhost’ svg
刷新权限并查看权限的写法:
FLUSH PRIVILEGES;
select * from user;code
注意:在建立用户前须要加一句
Use mysql;server
另外,收回某种权限的写法是:
REVOKE select
ON .
FROM ‘u1’@’localhost’;xml
(这些都是我今晚踩了不少坑总结出来的血泪教训……)input