Discuss MySQL datatypes question in the MySQL Help forum on Dev Shed. MySQL datatypes question MySQL Help forum discussing administration, SQL syntax, and other MySQL-related topics. MySQL is an open-source relational database management system (RDBMS).
Time spent in forums: 15 h 31 m 57 sec
Reputation Power: 10
MySQL datatypes question
I am making my own project which would entail in having loads of text, which datatypes should I use for the MySQL database? VARCHAR or MEDIUMTEXT? I don't think I will be using the LONGTEXT as it is too much for what I am creating the database for. The limit is for 2000 characters to be stored in the database
Last edited by cssbonding : September 9th, 2013 at 10:35 AM.
Time spent in forums: 1 Month 1 Week 2 Days 22 h 23 m 5 sec
Reputation Power: 1585
Depending on what use you'd wish to make of the data I'd be inclined to go for VARCHAR.
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc
Time spent in forums: 2 Weeks 4 Days 8 h 3 m 24 sec
Reputation Power: 369
unless i am wrong, varchar(255) is what the max is so you can store 255 chars as you rightly point out.
i think medium text is fine but go for the "var char version" i.e. you have char (fixed length) and then you have varchar. there is a "medium text" version for either so go for variable length type! (lol if that made sense)