• 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)新建一张可读的数据库表

  • 相关阅读:
    出差公干,人在北京,欢迎骚扰
    义乌江东货运市场托运指南
    哥伦比亚拖鞋批发,60双起批发仅售11,现货3240双,义乌给力商务有限公司诚意供货,发韵达或指定物流
    员工心态 老板心态 学生心态
    淘宝卖家
    开源问题系统
    当一回"青年导师"
    义乌工商学院到给力百货有多远,怎么走?
    我也八卦,姚晨和它男人离婚的事,意料之外,情理之中,吼吼,我是在迅雷看看的评论中看到的
    新浪车模程序写得很有意思
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13314106.html
Copyright © 2020-2023  润新知