Adam,

> I've got to create a table that has the following:
> 
> CREATE TABLE access (
>    query VARCHAR(255) NOT NULL,
>    INDEX (query)
> );
> 
> and mysql is telling that the max bytes allowed is 500 for key length. 
> The docs say I can change this by recompiling, which I would like to 
> avoid having to do. Is there any way around this to get a 255 character 
> length field with index?

Looks like you default character set is using 2 bytes per symbol.
In this case varchar(255) using 510 bytes and it is more than 500.

> This is going to store weblog entries, so it's going to be a huge table. 
> Is there a different table type / column type / index type I could use 
> to achieve what I need?

But you can create index that use only part of the query column:

CREATE TABLE access (
   query VARCHAR(255) NOT NULL,
   INDEX (query(200))
);

See more details here http://www.mysql.com/doc/en/CREATE_INDEX.html

Best regards,
Mikhail.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to