Solved

MySQL Text field limit?

Posted on 2007-03-29
4
1,752 Views
Last Modified: 2007-12-19
I'm using Apache 2.0.59 and PHP 5.2.1, and connecting to a MySQL 4.1 database
using PDO.

My problem is, I'm trying to write to a text column in a table and then
read it back out, and somewhere along the way my data gets truncated to
64K. It appears that the data is in the text column correctly but I can't
be certain.

Any idea what might be causing this?


0
Comment
Question by:yodercm
  • 2
  • 2
4 Comments
 
LVL 28

Accepted Solution

by:
gamebits earned 500 total points
ID: 18821131
Today’s scary discovery: MySQL TEXT fields have a limit of 65,000 bytes. If you insert anything larger than that in to a normal TEXT field mySQL will silently truncate your data without telling you (meaning software checks are probably a good idea). MEDIUMTEXT will store 16 million characters and LONGTEXT can handle over 4 trillion, but this information does not appear to be readily available in the online mySQL manual (although it is hinted at in this table). Something to bare in mind when designing database applications.

From

http://simonwillison.net/2002/Aug/1/mysqlTextLimits/
0
 
LVL 27

Author Comment

by:yodercm
ID: 18821136
Never mind, I found the answer, but this system won't let me delete the question.
0
 
LVL 27

Author Comment

by:yodercm
ID: 18821137
LOL OK, gamebits, you get the points for speed :)))
0
 
LVL 28

Expert Comment

by:gamebits
ID: 18821147
Thanks for the points and the grade, but you can asked a moderator to delete the question, I would not opposed.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question