mysql8.0创建用户授予权限时报错的问题分析和解决办法
我遇到错误一: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’;
以下是正确的写法:
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;
上一篇: 新生儿怎样选择合适衣物
下一篇: 判断孩子扁平足 5妙方治疗是关键