nacos版本:2.0.3
mysql:8.x
此时持久化配置的时候需要给nacos配置文件中数据库连接配置添加以下信息:
allowPublicKeyRetrieval=true
完整配置:
spring.datasource.platform=mysql
db.num=1
# note: must use ruoyi-mysql as the database service, can't use localhost or 127.0.0.1. Nacos will try to connect the ip:3306 from the docker contain, not the host machine
db.url.0=jdbc:mysql://ruoyi-mysql:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
db.user=root
db.password=mysqladmin