【MySQL】MySQL数据库的用户权限管理
# docker exec -it mysql mysql -u root -p"[email protected]"
查看MySQL数据库管理员[email protected]‘localhost’ 的用户权限
> select * from mysql.user where user="root" and host='localhost' \G;
> CREATE DATABASE IF NOT EXISTS zabbix DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
> GRANT ALL PRIVILEGES ON zabbix.* TO [email protected]'%' IDENTIFIED BY '[email protected]';
> flush privileges;
> show databases;
> select user,host from mysql.user;
> select * from mysql.user where user="zabbix" and host='%' \G;
> show grants for [email protected]'%';
业务账号权限的微粒控制,只能通过grant,无法通过修改mysql.user 表。
MySQL用户及权限
https://zhuanlan.zhihu.com/p/55798418
MySQL用户管理
https://www.cnblogs.com/kissdodog/p/4173337.html
MySQL权限管理:将业务账号的控制到最小
https://www.jianshu.com/p/efd5bc1087ac