List:General Discussion« Previous MessageNext Message »
From:Francis Mak Date:January 7 2004 10:20am
Subject:max length of primary key
View as plain text  
Hi,

I have a problem when creating a table:


CREATE TABLE test (
    test_key varchar(255) NOT NULL default '',
    test_value text NOT NULL,
    PRIMARY KEY (test_key) ) TYPE=MYISAM;

It then report error:

mySQL Error: Specified key was too long. Max key length is 500

Why the varchar exceeded 500?
I have a "set-variable    = default-character-set=utf8" in my.cnf,  maybe
this is the cause of error?
And is there way to increase this 500 value?  Or I must use InnoDB then?

Mysql 4.1.1, RedHat 9

Thanks.

Francis Mak

Thread
max length of primary keyFrancis Mak7 Jan
  • Re: max length of primary keyMartijn Tonies7 Jan