org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘externalDump

  在学习SpringCloud Alibaba Nacos时,出现了上述异常,因为我的数据库是8.0+版本,所以得在nacos的application.properties文件中db.url.0那一行加上参数useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC,这样就不会报上述错误了。

  配置如下:

nacos.istio.mcp.server.enabled=false

spring.datasource.platform=mysql
#jdbc.DriverClassName=com.mysql.cj.jdbc.Driver   这行可加可不加
db.num=1
db.url.0=jdbc:mysql://localhost:3306/你创建的数据库名称?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
db.user=root
db.password=你的数据库密码

  如果报org.springframework.jdbc.CannotGetJdbcConnectionException: PreparedStatementCallback; Could not retrieve transation read-only status server; nested exception is java.sql.SQLException: Could not retrieve transation read-only status server异常的, 请看我的这篇博客https://blog.csdn.net/ls_wifi/article/details/107922284

 

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值