views:

322

answers:

3

I am having difficulty storing more than 64000 in a column defined as mediumtext within mysql. I ran into this limitation with the text datatype earlier and decided to drop the column and recreate it as a mediumtext field. Trouble is, my data is getting truncated at 64000 bytes.

I did double check that the field is now a medium text field. The best I can tell, you don't have to specify the length when creating the column like you would with a varchar field.

Any ideas why this would be limited to 64000 and how to change it?

A: 

you should set max_packet_size in my.cnf

do you have a thread about that... here

saludos

Gabriel Sosa
I am in a hosted environment and don't believe I can change this value. Do you really feel this is the limitation? If so, what should it be set to?
I got the vote down and I dont know why... my reply is pretty similar to the one you accepted
Gabriel Sosa
Not sure why the down vote - Whilst this was not the answer, it would have been a valid thing to check if the datasource setting turned out not to be the cause.
Peter Boughton
+1  A: 

I would try inserting something very long using the MySQL client if you can, just to double check that things work. If it doesn't, "SHOW WARNINGS" should tell you what happened.

I can't help but wonder if this is some kind of Cold Fusion thing (I have no experience with it). Mediumtext should be long enough, and you verified that things changed.

Gabriel suggested a maximum packet size limitation. It's a good idea, but I kind of doubt that's it. The default size is 1MB, which shouldn't be a problem unless you are sending multiple inserts/updates at a time.

You can ask your hosting provider what the current size is. If it is very small, you can always ask if they would be willing to increase it. On the other hand if it's 8MB, 16MB or more, I doubt that would be the problem (again, unless you are batching up many large changes).

What exactly does the table definition look like when you do a describe? Unless it says something like "MEDIUMTEXT(65536)", that shouldn't be your problem.

MBCook
+2  A: 

There's an option in the CF Admin datasource advanced section to set the maximum column size, and it defaults to 64000, so it seems very likely this is your problem.

If you don't have access to CF Administrator yourself, you'll need to contact your hosting provider and ask them to increase it for you.

Peter Boughton
Excellent! That was it. For others who may find this...Under your datasources, click on advanced options and adjust the value for "Long Text Buffer (chr)". Thanks!