您的位置:首页 > 博客中心 > 数据库 >

MySQL用户和权限

时间:2022-03-14 04:58

1、创建用户

格式:grant 权限 on 数据库.* to 用户名@登录主机 identified by "密码"

mysql>grant all on *.* to test@"%" identified by "123456";

mysql>flush privileges;

2、修改密码

mysql>update mysql.user set password=password(‘123456‘) where User=‘test‘ and Host=‘localhost‘;

mysql>flush privileges;

3、删除用户

mysql>delete from user where user=‘test1‘ and host=‘localhost‘;

mysql>flush privileges;

热门排行

今日推荐

热门手游