mysql - 账号授权
登录mysql后才可操作
创建账号
create user 'cenxi'@'%' identified with mysql_native_password by '666cenxi666';
给所有权限
grant all privileges on *.* to 'cenxi'@'%' with grant option;
仅仅给指定库[cxbase]权限
grant all privileges on cxbase.* to 'cenxi'@'%' with grant option;
仅仅给指定库[cxbase] 只读 权限
grant select on cxbase.* to 'cenxi'@'%';
清除所有权限
revoke all on *.* from cenxi;
刷新权限
flush privileges;
查看权限
show grants for cenxi
删除账号
DROP USER 'cenxi'@'%';
注意,如果是高版本或者maraidb
创建并授权指令为
grant all privileges on *.* to 'cenxi'@'%' identified by '密码';
记得刷新
flush privileges;
本文来自博客园,作者:岑惜,转载请注明原文链接:https://www.cnblogs.com/c2g5201314/p/16445331.html
响应开源精神相互学习,内容良币驱除劣币

浙公网安备 33010602011771号