亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

我跟著教程寫的,為什么執行測試類的時候感覺連不上數據庫?

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:?

### Error querying database.? Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

### The error may exist in file [/Users/cn40258/demo/target/classes/mapper/AreaDao.xml]

### The error may involve com.imooc.demo.dao.AreaDao.queryArea

### The error occurred while executing a query

### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!


正在回答

6 回答

同學好,請檢查你的數據庫版本與驅動的兼容性,建議你使用5.X數據庫版本,現在感覺你用了8.0

0 回復 有任何疑惑可以回復我~

?Connections could not be acquired from the underlying database!


0 回復 有任何疑惑可以回復我~

能不能支持我下,幫我解決下,萬分感謝,謝謝!

0 回復 有任何疑惑可以回復我~

我的mysql版本是5.0.22的驅動試了的是5.0.4以及5.1.34版本的,為什么還是報

Caused by: java.sql.SQLException: No suitable driver

0 回復 有任何疑惑可以回復我~

同遇到了這個問題,感謝老師的回答,我導入了8.0的jar包,而我mysql的版本是5.62的應該用5.1的jar包,去官網(https://dev.mysql.com/downloads/connector/j/)? 下載的話要點一下邊上的?Looking for previous GA versions??才能下載到5.1的版本。

0 回復 有任何疑惑可以回復我~

謝謝,問題已解決~

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

我跟著教程寫的,為什么執行測試類的時候感覺連不上數據庫?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號