I have a very long text to save into this field. It's beyond 65,535kb. When I save it through PHP, MySQL cuts it at 65,535 and does not save all of the content. How can I workaround that?
Asked
Active
Viewed 141 times
0
-
1Sorry, but If your text is that long, why you don't simply save it as file on disk and have its path in mysql ? – Shady Atef Jan 03 '17 at 22:36
-
3switch to MEDIUMTEXT (16 meg) or LONGTEXT (4 gig) – Jan 03 '17 at 22:43
-
Take out the space and you have your answer `LONGTEXT`.. – chris85 Jan 03 '17 at 22:43
-
one solution would be to chunk up the data into pieces of manageable size and insert multiple rows. you would need an extra column to take an id that is unique for that group of rows. – CodingInTheUK Jan 03 '17 at 22:44
1 Answers
-2
You could use INNODB to solve this problem
(Included in every MySQL installation from 5.5 [ Ref: https://en.wikipedia.org/wiki/InnoDB ])
SET GLOBAL innodb_file_format=Barracuda;
SET GLOBAL innodb_file_per_table=ON;
With these two commands you should be able to create bigger TEXT columns. (Only for new tables though)

Community
- 1
- 1

robske_110
- 313
- 2
- 8