mysql授权用户

发布于:2020-03-26 04:58:08

1.查看mysql数据库中所有用户

SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;

2.查看数据库中具体某个用户的权限

show grants for 'cactiuser'@'%'  

3.查看user表结结构 

desc mysql.user

4.添加用户


grant all privileges on db_name.* to db_user@'%' identified by 'db_pass';


flush privileges;

阅读 107

匿名用户

授权成功