linux中mysql添加用户


## 1.创建用户和赋权

#创建用户
create user aaaa@'localhost' identified by 'bbbb';
update mysql.user set Host='%' where User='aaaa' and Host='localhost';
#赋权
grant all privileges on *.* to aaaa@'%';

## 2.删除用户和查看

#删除用户
DROP USER 'aaaa'@'%';
#查看用户
SELECT User, Host FROM mysql.user;
#为某张表赋权限
grant all privileges on DbName.* to aaaa;

你可能感兴趣的:(linux,mysql)