sql column length error
Posted: Thu Oct 22, 2009 7:36 am
I have a requirement that a table has to contain 3 columns, user_id, url and name. I want to make the url primary key. Go throw the following sql query.
How can I fix the above error ???
Code: Select all
mysql> CREATE TABLE blog_details (
-> user_id INT(11),
-> blogname VARCHAR(1024),
-> blogurl VARCHAR(1024) NOT NULL,
-> PRIMARY KEY(blogurl),
-> FOREIGN KEY (user_id) REFERENCES login(user_id)
-> ON DELETE CASCADE
-> );
ERROR 1071 (42000): Specified KEY was too long; max KEY length IS 767 bytes