#创建用户,此时只有链接数据库的权限,需后续授权
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(增删用户)
最新推荐文章于 2024-12-17 16:11:14 发布
本文介绍如何在MySQL中创建用户、授权及删除用户等基本操作。包括使用create user创建用户,通过grant语句分配权限,flush privileges刷新权限表,以及show grants查看用户权限。
1544

被折叠的 条评论
为什么被折叠?



