java.sql.SQLException: Could not retrieve transation read-only status server

org.springframework.dao.TransientDataAccessResourceException: <|### Error querying database.  Cause: java.sql.SQLException: Could not retrieve transation read-only status server<|### The error may exist in com/shishuo/cms/dao/ConfigDao.xml<|### The error may involve defaultParameterMap<|### The error occurred while setting parameters<|### SQL: select * from config where `key`=?<|### Cause: java.sql.SQLException: Could not retrieve transation read-only status server|; SQL []; Could not retrieve transation read-only status server; nested exception is java.sql.SQLException: Could not retrieve transation read-only status server
	at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:107)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
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)
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:4187)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731)




连接mysql数据库出现上述错误,由于mysql数据库与jdbc版本兼容问题导致,出现此错误时用的是mysql6.0;jdbc用的是5.0.12,改成最新的5.0.31就好了
 
  

你可能感兴趣的:(myeclipse)