赞
踩
Caused by: com.alibaba.nacos.api.exception.NacosException: Nacos Server did not start because dumpservice bean construction failure :
No DataSource set
报错开始行
2022-11-10 16:03:34,323 ERROR HikariPool-1 - Exception during pool initialization.
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
后面找到一行关键错误
Caused by: com.mysql.cj.exceptions.CJException: Access denied for user 'root'@'host.docker.internal' (using password: YES)
一般来讲本地数据库是不会放开远程连接的 所以我这边是新建一个用户 并授权 开始远程连接
创建nacos用户
create user 'nacos'@'%' identified by '123456';
将nacos数据管理权限授权给nacos
grant all privileges on nacos.* to `nacos`@'%';
将新配置刷新到缓存中,这样就不用重启数据库
flush privileges;
修改配置
application.properties文件
#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
spring.datasource.platform=mysql
### Count of DB:
db.num=1
### Connect URL of DB:
db.url.0=jdbc:mysql://192.168.16.102:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=nacos
db.password.0=123456
再次启动
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。