java.sql.SQLException: Access denied for user ‘xxx‘@‘localhost‘ (using password: YES)
生活随笔
收集整理的這篇文章主要介紹了
java.sql.SQLException: Access denied for user ‘xxx‘@‘localhost‘ (using password: YES)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
錯誤日志:
java.sql.SQLException: Access denied for user 'xxx'@'localhost' (using password: YES)at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.25.jar:8.0.25]at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.25.jar:8.0.25]at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:833) ~[mysql-connector-java-8.0.25.jar:8.0.25]at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:453) ~[mysql-connector-java-8.0.25.jar:8.0.25]at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) ~[mysql-connector-java-8.0.25.jar:8.0.25]at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[mysql-connector-java-8.0.25.jar:8.0.25]at com.mysql.cj.jdbc.MysqlDataSource.getConnection(MysqlDataSource.java:416) ~[mysql-connector-java-8.0.25.jar:8.0.25]at com.mysql.cj.jdbc.MysqlDataSource.getConnection(MysqlDataSource.java:128) ~[mysql-connector-java-8.0.25.jar:8.0.25]at com.mysql.cj.jdbc.MysqlDataSource.getConnection(MysqlDataSource.java:113) ~[mysql-connector-java-8.0.25.jar:8.0.25].... 2022-07-10 11:46:33.555 INFO 23360 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL57Dialect 2022-07-10 11:46:33.967 WARN 23360 --- [ restartedMain] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1045, SQLState: 28000 2022-07-10 11:46:33.967 ERROR 23360 --- [ restartedMain] o.h.engine.jdbc.spi.SqlExceptionHelper : Access denied for user 'xxx'@'localhost' (using password: YES) 2022-07-10 11:46:33.972 ERROR 23360 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution 2022-07-10 11:46:33.973 WARN 23360 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution 2022-07-10 11:46:33.975 INFO 23360 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2022-07-10 11:46:33.984 INFO 23360 --- [ restartedMain] ConditionEvaluationReportLoggingListener :可能的問題
1. 配置了數據庫連接池:
問題: 配置了數據庫連接池:spriing.datasource.type: com.mysql.cj.jdbc.MysqlConnectionPoolDataSource
解決辦法 改用阿里巴巴的連接池
總結
以上是生活随笔為你收集整理的java.sql.SQLException: Access denied for user ‘xxx‘@‘localhost‘ (using password: YES)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: hihoCoder挑战赛16 王胖浩与三
- 下一篇: uniapp 阿里云开发微信小程序一键登