执行下面的命令MySQL8会报错:
grant all privileges on db_name.* to 'root'@'%' ### Cause: java.sql.SQLSyntaxErrorException: Access denied for user 'root'@'%' to database 'db_name'
解决办法:
SELECT `User`, `Grant_priv` FROM `mysql`.`user` WHERE `User` = 'root'; UPDATE `mysql`.`user` SET `Grant_priv` = 'Y' WHERE `User` = 'root'; grant all privileges on *.* to 'root'@'%'; FLUSH PRIVILEGES;
MySQL8的root远程授权
CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密码'; GRANT ALL ON *.* TO 'root'@'%'; FLUSH PRIVILEGES;
标签:帐号,Grant,MySQL8,User,mysql,root,user From: https://www.cnblogs.com/liughost/p/17285958.html