IDEA连接mysql报错Access denied for user ‘’@‘localhost’ (using password: NO)
特别记录一下这个错误,网上的各种办法,我还重装了数据库。。。
这个错误,有可能是你的pom.yml中的配置文件写错了,IDEA自动提示的是错误的
spring:
datasource:
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/lh
username: root
password: root
应该这样写,写完后有可能报错The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time
这个错误加上只需要在数据库连接地址上加上**?serverTimezone=UTC**即可解决时区的报错
spring:
datasource:
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/lh?serverTimezone=UTC
username: root
password: root