春季拒绝用户“user_name@”localhost”(使用密码:NO)的访问

时间:2021-07-24 09:20:39

标签: mysql spring spring-boot hibernate

我正在尝试使用 mysql conenction 创建一个 java spring 应用程序,但收到此错误:

Access denied for user 'aurelian'@'localhost' (using password: NO)

请注意,我有用户/密码和应用程​​序属性,我的服务器已打开且密码正确:

     `######## Database Properties #######
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/spring_reddit_clone
spring.datasource.username=aurelian
spring.datasourxce.password=XXXXXXXXXXXXXX
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.hibernate.ddl-auto=update
spring.datasource.initialize=true
spring.jpa.show-sql=true**strong text**`

另外我正在使用 mysql-connector-java-8.0.25.jar 所以我没有任何想法。

最好的问候, 奥勒良

1 个答案:

答案 0 :(得分:2)

错字提醒。

将数据源更改为数据源

spring.datasource.password=XXXXXXXXXXXXXX

相关问题