Jump to content

#1170 key specification without a key length


grace5

Recommended Posts

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!

 

 

 

 

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 '',

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;

 

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.