<p>I need to store a url in a MySQL table. What's the best practice for defining a field that will hold a URL with an undetermined length?</p>

```
VARCHAR(512)
```
(or similar) should be sufficient.  However, since you don't really know the maximum length of the URLs in question, I might just go direct to
```
TEXT
```
.  The danger with this is of course loss of efficiency due to
```
CLOB
```
s being far slower than a simple string datatype like
```
VARCHAR
```
.