• Could not retrieve transation read-only status server


    1、错误描述

    Caused by: java.sql.SQLException: Could not retrieve transation read-only status server
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:902)
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:892)
    	at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3607)
    	at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3576)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2107)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2077)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2062)
    	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeUpdate(FilterChainImpl.java:2723)
    	at com.alibaba.druid.filter.FilterAdapter.preparedStatement_executeUpdate(FilterAdapter.java:1069)
    	at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeUpdate(FilterEventAdapter.java:491)
    	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeUpdate(FilterChainImpl.java:2721)
    	at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeUpdate(PreparedStatementProxyImpl.java:145)
    	at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeUpdate(DruidPooledPreparedStatement.java:253)
    	at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:916)
    	at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:909)
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:644)
    	... 30 more
    Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

    2、错误原因

           在运行系统时,将MySQL数据库服务重新启动了一下,结果再次访问系统出现这个错误


    3、解决办法

    (1)关闭服务器再重启

    (2)连接数据库的jar版本跟数据库不一致

  • 相关阅读:
    轨迹预测-运动递归函数
    Mandelbrot集合及其渲染
    如何检测一个圆在多个圆内?
    【转】三十分钟掌握STL
    【转】如何理解c和c++的复杂类型声明
    有1,2,3一直到n的无序数组,排序
    归并排序
    希尔排序
    快速排序
    冒泡排序
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13313900.html
Copyright © 2020-2023  润新知