不想用root用户备份mysql数据库,于是创建了专门用来备份数据库的用户,并赋予相应的权限。
grant select,lock tables on databasename.* to 'readonly'@'%' identified by '48bnw0vj'
grant select,lock tables on databasename.* to 'readonly'@'%' identified by '48bnw0vj'