1.创建账号
create user backupdb@'localhost' identified by '123456'; #或 create user backupdb@'%' identified by '123456';
2.设置权限
grant usage on *.* to backupdb@'localhost'; grant all privileges on mysql.* to backupdb@'localhost'; grant all privileges on *.* to backupdb@'localhost' with grant option; #或 grant usage on *.* to backupdb@'%'; grant all privileges on mysql.* to backupdb@'%'; grant all privileges on *.* to backupdb@'%' with grant option;
3.如果是高版本数据库需要修改登录验证
ALTER USER 'backupdb'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456'; #或 ALTER USER 'backupdb'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
标签:123456,grant,privileges,mysql,backupdb,MYSQL,权限,root,localhost From: https://www.cnblogs.com/-lizh/p/16910215.html