Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

42.17. Data truncation: Data too long for column 'content' at row 1

		
could not execute statement [Data truncation: Data too long for column 'content' at row 1] [update meeting set content=?,title=? where id=?]; SQL [update meeting set content=?,title=? where id=?]		
		
		

		
@Column(columnDefinition = "TEXT")
改成 MEDIUMTEXT 就没有问题了
@Column(columnDefinition = "MEDIUMTEXT")		
		
		

MySQL 中的文本字段分为TINYTEXT, TEXT, MEDIUMTEXT,LONGTEXT。

		
TINYTEXT: 256 bytes
TEXT: 65,535 bytes => ~64kb
MEDIUMTEXT: 16,777,215 bytes => ~16MB
LONGTEXT: 4,294,967,295 bytes => ~4GB