标签:href user 权限 主机 管理 授权 HERE mys mysql用户
增加用户并授权:
grant select,insert,update,delete on *.* to test@"%" Identified by "aaa";
#增加一个用户test,密码为aaa,该用户可在任何主机上(%)登录,并对所有数据库(*.*所有库的所有表)有查询、插入、修改、删除的权限:
查看用户情况:
SELECT User, Host, Password FROM mysql.user;
查看某个用户权限:
show grants for ‘usertest‘;
添加用户:
create user usertest identified by ‘aaa’;
用户授权:
grant all privileges on dbtest.* to usertest@‘%‘ identified by ‘aaa‘;
flush privileges;
修改用户密码:
update mysql.user set password = password(‘newpassword‘) where user = ‘usertest‘ and host = ‘%‘;
flush privileges;
删除用户:
drop user usertest@‘%‘;
标签:href user 权限 主机 管理 授权 HERE mys mysql用户
原文地址:https://www.cnblogs.com/lalalaya/p/10124058.html