grace5 Posted April 6, 2007 Share Posted April 6, 2007 I know very little about MySQL I am trying to alter a table for descriptions from a varchar(255) to a TEXT as I want more space for description lenght. I have tried this: SQL query: ALTER TABLE jade_sites CHANGE description description TEXT NOT NULL MySQL said: #1170 - BLOB/TEXT column 'description' used in key specification without a key length if I try to edit thru phpMyAdmin I get this error: ALTER TABLE `jade_sites` CHANGE `description` `description` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL MySQL said: #1170 - BLOB/TEXT column 'description' used in key specification without a key length any help would be thankfully received! Link to comment https://forums.phpfreaks.com/topic/45922-1170-key-specification-without-a-key-length/ Share on other sites More sharing options...
AndyB Posted April 6, 2007 Share Posted April 6, 2007 ALTER TABLE `videos` CHANGE `artist` `artist` TEXT NOT NULL That, and just that, worked perfectly for me when changing one of my tables. So try ALTER TABLE `jade_sites` CHANGE `description` `description` TEXT NOT NULL Link to comment https://forums.phpfreaks.com/topic/45922-1170-key-specification-without-a-key-length/#findComment-223076 Share on other sites More sharing options...
grace5 Posted April 12, 2007 Author Share Posted April 12, 2007 I get the same error: Error SQL query: ALTER TABLE `jade_sites` CHANGE `description` `description` TEXT NOT NULL MySQL said: #1170 - BLOB/TEXT column 'description' used in key specification without a key length Link to comment https://forums.phpfreaks.com/topic/45922-1170-key-specification-without-a-key-length/#findComment-227331 Share on other sites More sharing options...
fenway Posted April 12, 2007 Share Posted April 12, 2007 That's because you have a key on this column... drop the key first. Link to comment https://forums.phpfreaks.com/topic/45922-1170-key-specification-without-a-key-length/#findComment-227510 Share on other sites More sharing options...
grace5 Posted April 12, 2007 Author Share Posted April 12, 2007 how exactly is that done? Link to comment https://forums.phpfreaks.com/topic/45922-1170-key-specification-without-a-key-length/#findComment-228036 Share on other sites More sharing options...
fenway Posted April 13, 2007 Share Posted April 13, 2007 Show me the SHOW CREATE TABLE output... Link to comment https://forums.phpfreaks.com/topic/45922-1170-key-specification-without-a-key-length/#findComment-228423 Share on other sites More sharing options...
grace5 Posted April 13, 2007 Author Share Posted April 13, 2007 how do I do that? (sorry I am really not trying to be humble,I really don't know much about MySQL myphpadmin) could this be it? CREATE TABLE jade_sites ( id smallint(6) NOT NULL auto_increment, title varchar(100) NOT NULL default '0', url varchar(255) NOT NULL default '', dateadd datetime NOT NULL default '0000-00-00 00:00:00', id_cat smallint(6) NOT NULL default '0', description varchar(255) NOT NULL default '', Link to comment https://forums.phpfreaks.com/topic/45922-1170-key-specification-without-a-key-length/#findComment-228643 Share on other sites More sharing options...
bubblegum.anarchy Posted April 13, 2007 Share Posted April 13, 2007 grace5 - your create statement appears to be missing key/index definitions....is a index on `description` really necessary? consider removing the index on `description` (removing the index may have adverse effects): ALTER TABLE jade_sites DROP INDEX description, MODIFY description TEXT NOT NULL; Link to comment https://forums.phpfreaks.com/topic/45922-1170-key-specification-without-a-key-length/#findComment-228831 Share on other sites More sharing options...
grace5 Posted April 14, 2007 Author Share Posted April 14, 2007 DROP INDEX description thats the info I need to keep... Link to comment https://forums.phpfreaks.com/topic/45922-1170-key-specification-without-a-key-length/#findComment-228928 Share on other sites More sharing options...
grace5 Posted May 19, 2007 Author Share Posted May 19, 2007 hey this was not solved,I have never replied as last poster did not (or was not clear) on what my happen if I "DROP index" Link to comment https://forums.phpfreaks.com/topic/45922-1170-key-specification-without-a-key-length/#findComment-257258 Share on other sites More sharing options...
bubblegum.anarchy Posted May 20, 2007 Share Posted May 20, 2007 I do not know what the `adverse affects` may be - but you can drop the index and then add the index later if the site slows of breaks, though the site should not break for lack of an index as far as I know. Link to comment https://forums.phpfreaks.com/topic/45922-1170-key-specification-without-a-key-length/#findComment-257276 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.