连接阿里云数据库Mysql出错

kpj147 2016-03-16 01:04:44
### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 1 ms ago.
### The error may involve user.insertUser-Inline
### The error occurred while setting parameters
### SQL: insert into user(id,name) VALUES(?,?)
### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 1 ms ago.
; SQL []; Communications link failure

Last packet sent to the server was 1 ms ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 1 ms ago.
Caused by:

org.springframework.dao.RecoverableDataAccessException:
### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 1 ms ago.
### The error may involve user.insertUser-Inline
### The error occurred while setting parameters
### SQL: insert into user(id,name) VALUES(?,?)
### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 1 ms ago.
; SQL []; Communications link failure

Last packet sent to the server was 1 ms ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure


!!!!!!!!!!!!!!!!项目在本地Mysql连接正常!!!!!!!!!!!!!!!!!!
================================================================================================
myeclipse写的项目打成war包放在新浪云服务器上,第一次连接成功并插入数据。今天再试就报错了。一下是db.properties
使用spring+struts2+mybatis框架做的。

jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://rds3tpv5o3c17115989y.mysql.rds.aliyuncs.com:3306/xawl
jdbc.username=kpj
jdbc.password=1234563
cpool.checkoutTimeout=5000
cpool.minPoolSize=20
cpool.maxPoolSize=50
cpool.maxIdleTime=7000
cpool.maxIdleTimeExcessConnections=1800
cpool.acquireIncrement=10

------------------------------------------------
...全文
745 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
鲨鱼也是鱼 2016-10-26
  • 打赏
  • 举报
回复
你不会是写update 语句 用了insert 标签?
qingnianshi 2016-10-22
  • 打赏
  • 举报
回复
解决了没有?我遇到了相同的问题
Intboy 2016-03-18
  • 打赏
  • 举报
回复
用工具可以连接上服务器的MySQL数据库么?先确定下数据库正常。
MamyA 2016-03-18
  • 打赏
  • 举报
回复
你先登陆服务器,看看服务器的参数配置和实际使用配置有没有问题,如果没有话,就确定链接域名有没有问题,从sina云上面测试访问这个数据库地址看看是否可行。 第二种情况我遇到过,是阿里云的域名有问题,当时分了两个域名给我,一个内网RDB域名,一个是外网RDB域名,修改配置的时候配置错了,但是楼主这个,可以自查下,看看是什么问题。也不排除是阿里云RDB的解析服务器有问题,这个我也遇到过。
tianfang 2016-03-16
  • 打赏
  • 举报
回复
看看配置 mysql最多给你多少个连接,可能超了
kpj147 2016-03-16
  • 打赏
  • 举报
回复
求大神啊!!!!!!!!!1
kpj147 2016-03-16
  • 打赏
  • 举报
回复
引用 2 楼 shijing266 的回复:
光从问题看是链接超时,你用navicat连下库试试
navicat连接无问题,可以进去
  • 打赏
  • 举报
回复
光从问题看是链接超时,你用navicat连下库试试
kpj147 2016-03-16
  • 打赏
  • 举报
回复
求助啊 ,急

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧