solidcodes — 2012-07-09T22:34:56-04:00 — #1
I'm using PHPMyAdmin
and I have this error,
#1170 - BLOB/TEXT column 'urlname' used in key specification without a key length
This is the command I used,
ALTER TABLE `finishedurls` ADD `urlname` TEXT NOT NULL ,
ADD INDEX ( `urlname` )
Now How do I fix this?
Thanks in advanced.
r937 — 2012-07-09T23:11:51-04:00 — #2
specify a length
by the way, are you sure you want TEXT? TEXT is for, you know, big chunks of text, e.g. 200 kilobytes
an urlname sounds like it will easily fit into a modestly long VARCHAR, e.g. 200 bytes
solidcodes — 2012-07-10T07:59:57-04:00 — #3
But try this forum URL above for example it already reached 130 characters.
So I guess TEXT is the safest way.
Because VARCHAR is too short.
r937 — 2012-07-10T08:19:04-04:00 — #4
no, it's not
before mysql version 5.0.3, VARCHAR had a maximum length of 255
subsequently, VARCHAR has a maximum length of 65,535