ALTER TABLE syntax
ALTER TABLE `table_name` ADD INDEX (`text_field`(1000));
If you're like me and you forget to add the character length, you'll probably receive a #1170 SQL-query error that reads something like:
#1170 - BLOB/TEXT column 'text_field' used in key specification without a key length
which might occur if you try to alter the table in the future using phpMyAdmin.
After running the alter table command above do a quick repair operation of the table to rebuild the indexes:
mysql> REPAIR TABLE tbl_name QUICK;
0 Comments:
Post a Comment
<< Home