Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to store a URL value using MySQL?

I was thinking of storing URL values in my database but I know some URL's sometimes get ridiculously long. I think my MySQL Database is Version 5.0.

I was thinking of using.

VARCHAR(255) 

but this will only work for so long. So should I use.

TEXT 
like image 739
mii Avatar asked Nov 15 '09 03:11

mii


1 Answers

The maximum length of a VARCHAR in MySQL 5.0 is 65536, so you're not limited to 255.

like image 63
pavium Avatar answered Sep 21 '22 06:09

pavium