Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:
# # # Error updating database. Cause:java.sql.SQLException:Could not retrieve transation read-only status server
# # # The error may involve zhao.ai.nan.dao.persondao.insert-inline
# # # The error occurred while setting parameters
# # # Sql:insert into person (Name,password) VALUES (?,?)
# # Cause:java.sql.SQLException:Could Not retrieve transation read-only status server
At Org.apache.ibatis.exceptions.ExceptionFactory.wrapException (exceptionfactory.java:23)
At Org.apache.ibatis.session.defaults.DefaultSqlSession.update (defaultsqlsession.java:147)
At Org.apache.ibatis.session.defaults.DefaultSqlSession.insert (defaultsqlsession.java:134)
At Org.apache.ibatis.binding.MapperMethod.execute (mappermethod.java:79)
At Org.apache.ibatis.binding.MapperProxy.invoke (mapperproxy.java:40)
At $Proxy 0.insert (Unknown Source)
At Zhao.ai.nan.test.Main.main (main.java:37)
caused by:java.sql.SQLException:Could not retrieve transation read-only status server
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:1078)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:989)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:975)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:920)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:951)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:941)
At Com.mysql.jdbc.ConnectionImpl.isReadOnly (connectionimpl.java:3936)
At Com.mysql.jdbc.ConnectionImpl.isReadOnly (connectionimpl.java:3907)
At Com.mysql.jdbc.PreparedStatement.checkReadOnlySafeStatement (preparedstatement.java:1258)
At Com.mysql.jdbc.PreparedStatement.execute (preparedstatement.java:1278)
At Org.apache.ibatis.executor.statement.PreparedStatementHandler.update (preparedstatementhandler.java:41)
At Org.apache.ibatis.executor.statement.RoutingStatementHandler.update (routingstatementhandler.java:66)
At Org.apache.ibatis.executor.SimpleExecutor.doUpdate (simpleexecutor.java:45)
At Org.apache.ibatis.executor.BaseExecutor.update (baseexecutor.java:108)
At Org.apache.ibatis.executor.CachingExecutor.update (cachingexecutor.java:75)
At Org.apache.ibatis.session.defaults.DefaultSqlSession.update (defaultsqlsession.java:145)
... 5 more
caused by:java.sql.SQLException:Unknown system variable ' tx_read_only '
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:1078)
At Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:4120)
At Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:4052)
At Com.mysql.jdbc.MysqlIO.sendCommand (mysqlio.java:2503)
At Com.mysql.jdbc.MysqlIO.sqlQueryDirect (mysqlio.java:2664)
At Com.mysql.jdbc.ConnectionImpl.execSQL (connectionimpl.java:2809)
At Com.mysql.jdbc.ConnectionImpl.execSQL (connectionimpl.java:2758)
At Com.mysql.jdbc.StatementImpl.executeQuery (statementimpl.java:1612)
At Com.mysql.jdbc.ConnectionImpl.isReadOnly (connectionimpl.java:3930)
... More
Unknown system variable ' tx_read_only '
Solution: There is a problem with the version of the MySQL database and the driver package that is used by the database. Change the version of the driver package
Error logging and Solutions