spring boot中data truncation data too long for column问题
生活随笔
收集整理的這篇文章主要介紹了
spring boot中data truncation data too long for column问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
為什么80%的碼農都做不了架構師?>>> ??
問題
根據報錯可知,就是之前在數據庫中定義的字段太短了,存不下新的數據
解決
@Column(length = 3000)private String cellExcel;手動定義字段長度,但這不會對已經存在對表進行生效,故還是需要使用SQL語句手動修改表字段長度,即:
ALTER TABLE budgetdb.form_template_field MODIFY COLUMN cell_excel VARCHAR(3000);參考
- com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'aboutMeText' at row 1
轉載于:https://my.oschina.net/fxtxz2/blog/3038766
總結
以上是生活随笔為你收集整理的spring boot中data truncation data too long for column问题的全部內容,希望文章能夠幫你解決所遇到的問題。