mysql备份数据库需要的权限
执行备份的账号,需要的权限为:reload,REPLICATION CLIENT,select
GRANT reload ON *.* TO 'backup'@'localhost' WITH GRANT OPTION;
GRANT REPLICATION CLIENT ON *.* TO 'backup'@'localhost' WITH GRANT OPTION;
GRANT select ON *.* TO 'backup'@'localhost' WITH GRANT OPTION;
mysqldump 使用 --single-transaction --master-data=2 参数,不用 LOCK TABLES ;如果是线上操作,最好不使用 lock tables 权限,因为将表锁住,后续插入无法完成.