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.4k
2 个回答
新手上路,请多包涵

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

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

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题