nacos启动报错解决方法:Unsatisfied dependency expressed through constructor parameter 0; nested exception is

nacos启动时报错:/alibaba/nacos/config/server/monitor/MemoryMonitor.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'asyncNotifyService': Unsatisfied dependency expressed through field 'dumpService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'externalDumpService': Invocation of init method failed; nested exception is ErrCode:500, ErrMsg:Nacos Server did not start because dumpservice bean construction failure :
No DataSource set

网上查询都指出是application.properties文件下mysql设置有问题导致连接失败,设置的连接地址、用户名密码等没有问题。尝试了以下方法未解决:

1、db.url、db.user、db.password后面都加.0,即改为:db.url.0=jdbc:mysql://127.0.0.1:3306,db.user.0=root,db.password.0=123456。在前面配置中有db.num=1,加.0以后指定数据库序号。出错时已有该配置,未解决

2、db.url增加配置:&serverTimezone=UTC,指定时区;或调大超时时间:&connectTimeout=1000,尝试增加配置并调大时间为5000秒,未解决

3、本地mysql数据库为8.0,增加配置:db.driver-class-name=com.mysql.cj.jdbc.Driver,未解决

按以下方式解决:

db.url.0增加配置:&allowPublicKeyRetrieval=true,保存后重新启动nacos解决。

以下方式未尝试:

修改default_authentication_plugin设置,在my.ini中增加[mysqld]default_authentication_plugin=mysql_native_password,然后mysql命令行执行ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';最后在url中添加时区参数serverTimezone=Asia/Shanghai。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值