SSM-用Spring+Druid+Mybatis錯誤:com.alibaba.druid.support.logging.JakartaCommonsLoggingImpl error
如下報錯
com.alibaba.druid.support.logging.JakartaCommonsLoggingImpl error
嚴重: create connection SQLException, url: jdbc:mysql://192.168.211.129:3306/spring_db?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8&useSSL=false, errorCode 1045, state 28000
java.sql.SQLException: Access denied for user ''@'192.168.211.1' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1714)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1224)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2199)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2230)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2025)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1513)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466)
解決方案一
檢視applicationContext.xml(Spring配置檔案)配置檔案中的 name
值是否如下:
Druid資料來源
- name=“driverClassName” 不是 “driver”
- name=“url”
- name=“username” 不是 “name"或者"user”
- name=“password”
<!-- 引入外部檔案-->
<context:property-placeholder location="classpath:jdbc.properties"/>
<!-- 將資料來源交給IOC容器管理-->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
解決方案二
檢視:jdbc.properties
檔案是否書寫正確
- 連線賬戶和密碼是否正確
- 如果是用
mysql8.0
下面的jdbc.driver
要改成com.mysql.cj.jdbc.Driver
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://192.168.211.129:3306/spring_db?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8&useSSL=false
jdbc.username=root
jdbc.password=root
相關文章
- MySQL error 錯 誤 碼MySqlError
- PostgreSQL error 錯誤碼SQLError
- Error page: / Error infos: DedeCms錯誤警告Error
- React 高階應用 -- 錯誤邊界 Error BoundariesReactError
- Error Curves——錯誤曲線Error
- 用dbms_error記錄load時的錯誤Error
- 15-錯誤處理(Error)Error
- Js錯誤Error物件詳解JSError物件
- Datastore error in 'dirbdb'錯誤解決ASTError
- 執行SQL發生錯誤!錯誤:disk I/O errorSQLError
- HTTP 錯誤 500.19- Internal Server Error 錯誤解決方法HTTPServerError
- PHP curl error 60 錯誤解決PHPError
- MySQL ERROR 1698 (28000) 錯誤MySqlError
- HTTP 錯誤 500.19 - Internal Server ErrorHTTPServerError
- dedecms 搬家 / dedecms error warning!錯誤Error
- Angular 錯誤訊息:ERROR Error NullInjectorError No provider for XXAngularErrorNullIDE
- 【ERROR】Oracle列印錯誤程式碼解釋ErrorOracle
- Fatal NI connect error 12170 錯誤Error
- android 打包出現錯誤Error: ResourceNameAndroidError
- 使用error stack診斷特定錯誤資訊Error
- sloaris 出現“mount: I/O error”錯誤Error
- 錯誤處理:如何通過 error、deferred、panic 等處理錯誤?Error
- Python錯誤:PyCharm 安裝出錯 Internal error,please。。。PythonPyCharmError
- Golang 學習——error 錯誤處理淺談GolangError
- 2、MySQL錯誤日誌(Error Log)詳解MySqlError
- Http failure response 0 Unknown error 錯誤分析HTTPAIError
- 【ERROR】ORA-8103錯誤分析處理Error
- HTTP 錯誤 500.21 - Internal Server Error 解決方案HTTPServerError
- /var/log/message 錯誤error (network unreachable)Error
- 使用goldengate error log檢視錯誤資訊GoError
- /usr/bin/xauth: error in locking authority file錯誤Error
- TNS-04414 file error 錯誤解決Error
- Angular 依賴注入錯誤訊息:ERROR Error NullInjectorError No provider for XXAngular依賴注入ErrorNullIDE
- PBOOTCMS網站程式提示“執行SQL發生錯誤!錯誤:DISK I/O ERROR”boot網站SQLError
- mysql 索引長度 767 錯誤 ERROR 1071MySql索引Error
- 使用Boost庫報error C4996錯誤Error996
- DZ論壇MySQL Query Error Errno:1046錯誤MySqlError
- SAP Java Connector 錯誤 - JCO_ERROR_COMMUNICATIONJavaError