欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mysql存储大数据时,Row size too large

程序员文章站 2022-07-03 12:35:07
...
2019-01-23 16:36:04 [ERROR] - JDBCExceptionReporter.logExceptions - Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
2019-01-23 16:36:04 [ERROR] - AbstractFlushingEventListener.performExecutions - Could not synchronize database state with session
org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
    at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
    at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
    at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)
    at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
    at cn.kx.lj.core.orm.HibernateDBServcieImpl$TranHibernateTemplate.doCall(HibernateDBServcieImpl.java:56)
    at cn.kx.lj.core.orm.HibernateDBServcieImpl.update(HibernateDBServcieImpl.java:481)
    at cn.kx.lj.db.dao.BaseDao.update(BaseDao.java:105)
    at cn.kx.lj.gameserver.sys.SystemInfo$1.doIo(SystemInfo.java:340)
    at cn.kx.lj.core.async.AsyncOperation.execute(AsyncOperation.java:72)
    at cn.kx.lj.core.async.AsyncOperation$1.run(AsyncOperation.java:63)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

解决办法:

根据提示首先修改:

alter table t_info ROW_FORMAT=DYNAMIC;

如果提示warnings可以使用

show warnings;           查看具体警告

 

如果修改完还不生效:

1.SET GLOBAL innodb_file_per_table=1

2.SET GLOBAL innodb_file_format=Barracuda;

3.重新建表

相关标签: 字段过长