日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

java.sql.SQLException: Access denied for user ‘xxx‘@‘localhost‘ (using password: YES)

發布時間:2023/12/15 数据库 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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
解決辦法 改用阿里巴巴的連接池

1. pom文件添加依賴 <dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>1.2.6</version></dependency>2. 修改 yml 文件 spriing.datasource.type: com.alibaba.druid.pool.DruidDataSource

總結

以上是生活随笔為你收集整理的java.sql.SQLException: Access denied for user ‘xxx‘@‘localhost‘ (using password: YES)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。