鍍金池/ 問答/Java  Linux  數(shù)據(jù)庫/ mybatis用域名連接數(shù)據(jù)庫,出現(xiàn)連接池錯(cuò)誤?

mybatis用域名連接數(shù)據(jù)庫,出現(xiàn)連接池錯(cuò)誤?

org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)

我之前改成localhost就行了

現(xiàn)在服務(wù)器跟數(shù)據(jù)庫不在一個(gè)服務(wù)器

只能用域名連接

結(jié)果又出現(xiàn)了

圖片描述

回答
編輯回答
扯機(jī)薄

mysql默認(rèn)只能本機(jī)連接,需要改一下配置文件

2017年8月27日 20:26