水善利万物而不争,处众人之所恶,故几于道💦
2024-02-18 17:31:42.230 ERROR 9473 --- [ main] com.alibaba.druid.pool.DruidDataSource : init datasource error, url: jdbc:mysql://localhost:3306/myblog?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
SpringBoot项目在windows上运行没有问题,但是,打jar包放到服务器上就数据库连不上!!!
解决办法:把yml配置文件中的数据源的密码用单引号引起来!!!
备注:我没学过Spring,还有这坑…,关键是不加单引号你好歹Windows上也给报个错呀,Windows上啥毛病没有,打包后就有问题,这不是坑爹嘛,害得我找了好久好久😭