Reputation: 4122
I am storing 250 character long text messages into my mysql DB.
What type should I store it as? Right now I am using text which is (64KB) and that seems to be a little to much of what I need. Or must I use the type (text) of I want to support muliple languishes utf-8 ?
Upvotes: 1
Views: 755
Reputation: 835
varchar with a suitable length is better than text in your case.
Upvotes: 0
Reputation: 3675
First, a TEXT type is not 64K but goes up to GBs. Second, if your string is 250 chars, why don't you use VARCHAR which can accommodate up to 64K (which is more than enough even if you have UTF-8 encoding?
Upvotes: -1
Reputation: 21
I think a varchar(255) is enought for your case. Just test it and see if it's good ;)
Upvotes: 2