Forum Moderators: coopster

Message Too Old, No Replies

capacity of text data type in mysql?

         

compose

11:11 am on Aug 2, 2006 (gmt 0)

10+ Year Member



Hello,

I have a question - what is capacity of Text data type in mysql? is it able to contain 15 - 20 pages text?

Vineet

moltar

11:32 am on Aug 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From MySQL 5.0 Reference Manual, Chapter 11.5:

TINYTEXT - L+1 byte, where L < 2^8
TEXT - L+2 bytes, where L < 2^16
MEDIUMTEXT - L+3 bytes, where L < 2^24
LONGTEXT - L+4 bytes, where L < 2^32

So the LONGTEXT can have a maximum of 4294967300 bytes. If you want to store ASCII text, then that's how many characters you can have. If you want UTF, then it's different - number of bytes varies.

Let's just assume for a moment that one page is 3000 characters (i.e. bytes in ASCII). You can store approximately 1431655 pages of text in LONGTEXT.

Scally_Ally

2:18 pm on Aug 2, 2006 (gmt 0)

10+ Year Member



I have had problems where i cannot store enough data in longtext, i have then used a blob which seems to store alot more than just the longtext.

compose

3:07 pm on Aug 2, 2006 (gmt 0)

10+ Year Member



Thanx for your input,

actually i am developing a article managemnt site, so is it good idea to store articles in database?

open for suggestions. :)

vineet

moltar

2:00 am on Aug 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, of course! Store those articles in the database. I sometimes even store pictures in the database as well.