久しぶりにMySQLを触る度に、毎度毎度権限関連のことを忘れてしまっていることに気づく。
最近は本業のネットワークエンジニアとしてもあまり実作業をしないものでコマンドの類を
忘れがちなので、本業ではないことだとなおさらか。
とりあえず検索性を高めるために、ここにメモをしておこうと思う。
# privileges for replication
GRANT REPLICATION SLAVE ON *.* TO 'repluser'@'<host>' IDENTIFIED BY '<password>'; |
# privileges for mysqldump
GRANT SELECT, RELOAD, FILE, LOCK TABLES, REPLICATION CLIENT, SHOW VIEW ON *.* TO 'bkupuser'@'<host>' IDENTIFIED BY '<password>'; |
# privileges for logrotate
GRANT RELOAD ON *.* TO 'logrotate'@'localhost' IDENTIFIED BY '<password>'; |
# privileges for monitoring from Zabbix Agent
GRANT SELECT, PROCESS, SHOW DATABASES, SUPER, REPLICATION CLIENT ON *.* TO 'monuser'@'localhost' IDENTIFIED BY '<password>'; |
# check granted privileges for an user
SHOW GRANTS FOR '<user>'@'<host>'; |
参考情報:
https://dev.mysql.com/doc/refman/5.5/en/grant.html
https://dev.mysql.com/doc/refman/5.5/en/show-grants.html
コメントを残す
コメントを投稿するにはログインしてください。