Why is only 64kB of data being saved in my MySQL data column?

后端 未结 4 1894
被撕碎了的回忆
被撕碎了的回忆 2021-02-07 22:41

I am trying to insert a very long text string into a MySQL Blob column, but MySQL is only saving 64kB of the data. The string is 75360 characters long. I am connecting with PHP\

4条回答
  •  生来不讨喜
    2021-02-07 23:17

    A BLOB type in MySQL can store up to 65,534 bytes, if you try to store more than this much data MySQL will truncate the data. MEDIUMBLOB can store up to 16,777,213 bytes, and LONGBLOB can store up to 4,294,967,292 bytes.

    If you enable strict SQL mode (MySQL modes) you will get an error when you try to store data that doesn't fit in the column type.

提交回复
热议问题