# docker exec -it mysql mysql -u root -p"MySQL@123"
查看MySQL数据库管理员root@‘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 zabbix@'%' IDENTIFIED BY 'Zabbix@123';
> flush privileges;
> show databases;
> select user,host from mysql.user;
> select * from mysql.user where user="zabbix" and host='%' \G;
> show grants for zabbix@'%';
业务账号权限的微粒控制,只能通过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