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

  • 相关阅读:
    数据结构(动态树):UOJ 207 共价大爷游长沙
    字符串(后缀自动机):NOI 2016 优秀的拆分
    数学(矩阵乘法):HDU 4565 So Easy!
    数据结构(线段树):NOI 2016 区间
    动态规划:NOI2013 快餐店
    图论(网络流):UVa 1659
    数学(矩阵乘法,随机化算法):POJ 3318 Matrix Multiplication
    数学(莫比乌斯反演):YY的GCD
    数学(莫比乌斯反演):HAOI 2011 问题B
    字符串(后缀自动机):USACO Dec10 恐吓信
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13314106.html
Copyright © 2011-2022 走看看