nacos连接MySQL:Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

参考 https://www.cnblogs.com/tingguoguoyo/p/11005584.html
1、进MySQL之后
2、输入以下语句,进入mysql库:
use mysql;
3、更新域属性,'%'表示允许外部访问:
update user set host='%' where user ='root';
4、执行以上语句之后再执行(刷新配置):
FLUSH PRIVILEGES;
5、再执行授权语句:
GRANT ALL PRIVILEGES ON . TO 'root'@'%'WITH GRANT OPTION;

posted @ 2020-09-11 22:12  蓝色和天空  阅读(2073)  评论(0)    收藏  举报