zoukankan      html  css  js  c++  java
  • The MySQL server is running with the --read-only option so it cannot execute this statement

    1、错误描述

    Caused by: java.sql.SQLException: The MySQL server is running with the --read-only option so it cannot execute this statement
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
    	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)
    	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
    	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2530)
    	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1907)
    	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1199)
    	
    	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:56)
    	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:70)
    
    	at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:606)
    	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59)
    	at com.sun.proxy.$Proxy36.query(Unknown Source)
    	at org.apache.ibatis.executor.ReuseExecutor.doQuery(ReuseExecutor.java:54)
    	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:259)
    	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:132)
    	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105)
    	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)
    	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)
    	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)
    	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:62)
    	at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:606)
    	at core.util.CustomSqlSessionTemplate$SqlSessionInterceptor.invoke(CustomSqlSessionTemplate.java:305)
    	... 81 more
    

    2、错误原因

         数据库表设置成只读,但是在修改更新操作时用到这张表,导致报错


    3、解决办法

    (1)将只读属性改为可写可读

    (2)新建一张可读的数据库表

  • 相关阅读:
    python : matplotlib does not work in Eclipse
    在线代码生成器的设计和使用
    Hama——BSP、Graph教程
    oozie:hadoop中的工作流引擎
    oracle命令建库全过程
    IntelliJ IDEA 自动生成方法注释(含参数及返回值)转+亲测IDEA2018.3
    转:Can't connect to MySQL server on 'XXXX' (10055) 解决方案
    资源的释放
    java中的break、continue、return的区别
    解析xml文件的方式
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13314106.html
Copyright © 2011-2022 走看看