20. pt-show-grants
Posted cyberbit
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了20. pt-show-grants相关的知识,希望对你有一定的参考价值。
pt-show-grants -h 192.168.100.101 -P 3306 -u admin -p admin
也可以delete,revoke,flush privileges , 用的不多,一般就是看看,拷贝赋权语句。
-- Grants dumped by pt-show-grants
-- Dumped from server 192.168.100.101 via TCP/IP, mysql 5.7.20-log at 2018-11-23 15:16:36
-- Grants for ‘admin‘@‘%‘
CREATE USER IF NOT EXISTS ‘admin‘@‘%‘;
ALTER USER ‘admin‘@‘%‘ IDENTIFIED WITH ‘mysql_native_password‘ AS ‘*4ACFE3202A5FF5CF467898FC58AAB1D615029441‘ REQUIRE NONE PASSWORD EXPIRE NEVER ACCOUNT UNLOCK;
GRANT ALL PRIVILEGES ON *.* TO ‘admin‘@‘%‘ WITH GRANT OPTION;
-- Grants for ‘mysql.session‘@‘localhost‘
CREATE USER IF NOT EXISTS ‘mysql.session‘@‘localhost‘;
ALTER USER ‘mysql.session‘@‘localhost‘ IDENTIFIED WITH ‘mysql_native_password‘ AS ‘*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE‘ REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT
LOCK;GRANT SELECT ON `mysql`.`user` TO ‘mysql.session‘@‘localhost‘;
GRANT SELECT ON `performance_schema`.* TO ‘mysql.session‘@‘localhost‘;
GRANT SUPER ON *.* TO ‘mysql.session‘@‘localhost‘;
-- Grants for ‘mysql.sys‘@‘localhost‘
CREATE USER IF NOT EXISTS ‘mysql.sys‘@‘localhost‘;
ALTER USER ‘mysql.sys‘@‘localhost‘ IDENTIFIED WITH ‘mysql_native_password‘ AS ‘*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE‘ REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT LOCK
;GRANT SELECT ON `sys`.`sys_config` TO ‘mysql.sys‘@‘localhost‘;
GRANT TRIGGER ON `sys`.* TO ‘mysql.sys‘@‘localhost‘;
GRANT USAGE ON *.* TO ‘mysql.sys‘@‘localhost‘;
-- Grants for ‘repl‘@‘%‘
CREATE USER IF NOT EXISTS ‘repl‘@‘%‘;
ALTER USER ‘repl‘@‘%‘ IDENTIFIED WITH ‘mysql_native_password‘ AS ‘*A424E797037BF97C19A2E88CF7891C5C2038C039‘ REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK;
GRANT ALL PRIVILEGES ON *.* TO ‘repl‘@‘%‘;
-- Grants for ‘root‘@‘localhost‘
CREATE USER IF NOT EXISTS ‘root‘@‘localhost‘;
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH ‘mysql_native_password‘ AS ‘*A8C4A68B1666D4A25F44FE4F1C2E16504D79B3BD‘ REQUIRE NONE PASSWORD EXPIRE NEVER ACCOUNT UNLOCK;
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘localhost‘ WITH GRANT OPTION;
GRANT PROXY ON ‘‘@‘‘ TO ‘root‘@‘localhost‘ WITH GRANT OPTION;
-- Grants for ‘user01‘@‘%‘
CREATE USER IF NOT EXISTS ‘user01‘@‘%‘;
ALTER USER ‘user01‘@‘%‘ IDENTIFIED WITH ‘mysql_native_password‘ AS ‘*C8B27DECB94F864D2395C39D43F5FCA5F82CD447‘ REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK;
GRANT DELETE, INSERT, SELECT, UPDATE ON `db01`.* TO ‘user01‘@‘%‘;
GRANT DELETE, INSERT, SELECT, UPDATE ON `sysbench`.* TO ‘user01‘@‘%‘;
GRANT USAGE ON *.* TO ‘user01‘@‘%‘;
以上是关于20. pt-show-grants的主要内容,如果未能解决你的问题,请参考以下文章
计算(1/2+1/3+...+1/20)+(2/3+2/4+...+2/20)+(3/4+3/5+...+3/20)+...+(18/19+18/20)+19/20等于多少
RSLogix5000 v20.01和v20.04的区别;v20.04中文版安装包
20.20 告警系统主脚本 20.21 告警系统配置文件 20.22 告警系统监控项目
20.5 shell脚本中的逻辑判断 20.6 文件目录属性判断 20.7 if特殊用法 20.8/20.9 case判断