MyBatis用域名连接数据库出现无法创建事物的问题?

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就行了

现在服务器跟数据库不在一个服务器

只能用域名连接

结果又出现了

阅读 2.6k
2 个回答
新手上路,请多包涵

换服务器之后 数据库密码换了吧

无法创建事务和域名连接没有关系,楼主的错误信息是连接异常,查查是不是网络问题。

推荐问题