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
- Angular 錯誤訊息:ERROR Error NullInjectorError No provider for XXAngularErrorNullIDE
- Js錯誤Error物件詳解JSError物件
- Fatal NI connect error 12170 錯誤Error
- 15-錯誤處理(Error)Error
- dedecms 搬家 / dedecms error warning!錯誤Error
- HTTP 錯誤 500.19- Internal Server Error 錯誤解決方法HTTPServerError
- 執行SQL發生錯誤!錯誤:disk I/O errorSQLError
- android 打包出現錯誤Error: ResourceNameAndroidError
- PHP curl error 60 錯誤解決PHPError
- Python錯誤:PyCharm 安裝出錯 Internal error,please。。。PythonPyCharmError
- 錯誤處理:如何通過 error、deferred、panic 等處理錯誤?Error
- 【Jenkins】data stream error|Error cloning remote repo ‘origin‘ 錯誤解決JenkinsErrorREM
- Angular 依賴注入錯誤訊息:ERROR Error NullInjectorError No provider for XXAngular依賴注入ErrorNullIDE
- mysql 索引長度 767 錯誤 ERROR 1071MySql索引Error
- 【ERROR】ORA-8103錯誤分析處理Error
- 【ERROR】Oracle列印錯誤程式碼解釋ErrorOracle
- Http failure response 0 Unknown error 錯誤分析HTTPAIError
- SAP Java Connector 錯誤 - JCO_ERROR_COMMUNICATIONJavaError
- Mysql連線錯誤ERROR 2003 (HY000)MySqlError
- QT中error: xxx does not name a type xxx錯誤QTError
- HTTP 錯誤 500.21 - Internal Server Error 解決方案HTTPServerError
- 2、MySQL錯誤日誌(Error Log)詳解MySqlError
- 解決 eslint 的 Parsing error: Unexpected token 錯誤EsLintError
- Golang 學習——error 錯誤處理淺談GolangError
- HTTP 錯誤 500.19 - Internal Server Error v4.0.30319HTTPServerError
- 使用Boost庫報error C4996錯誤Error996
- 【ERROR】su user報'This account is currently not available'錯誤 for linuxErrorAILinux
- 記錄redis佇列read error on connection to錯誤Redis佇列Error
- DZ論壇MySQL Query Error Errno:1046錯誤MySqlError
- 用VS2015匯入工程時出現error MSB8020錯誤Error
- PBOOTCMS網站程式提示“執行SQL發生錯誤!錯誤:DISK I/O ERROR”boot網站SQLError
- mysql 啟動錯誤(InnoDB: Operating system error number 13 )MySqlError
- mysqldump error1066 錯誤的解決辦法MySqlError