#创建用户,此时只有链接数据库的权限,需后续授权
create user 'scott@:localhost' identified by 'Scott';
#添加用户对sina数据库的所有权限
grant all privileges on sina.* to scott@localhost identified by 'Scott';
#上面这条grant语句在新版mysql将被弃用
#刷新系统权限表
flush privileges;
#显示用户权限
show grants for scott@localhost;
#删除用户
drop user scott@localhost;
Mysql:sql create user,grant,flush,drop user(增删用户)
最新推荐文章于 2025-01-06 15:32:36 发布