Microsoft
Software
Hardware
Network
Question : MYSQL - Specified Key was too long! Help!
Hi, i am trying to create a table in phpMyAdmin, and am at a loss at the error i am receiving which is as follows:
CREATE TABLE `alexremo_addo`.`products`
(`id` INT(5) NOT NULL AUTO_INCREMENT PRIMARY KEY, `category_id` INT(5) NOT NULL, `product_name` VARCHAR(255) NOT NULL, `product_sku` VARCHAR(255) NOT NULL, `product_quality` VARCHAR(255) NOT NULL, `product_weight` VARCHAR(10) NOT NULL, `product_enabled` ENUM('Y', 'N') NOT NULL, `product_stocked` INT(5) NOT NULL, `product_addhome` ENUM('N', 'Y') NOT NULL, `tax_class` ENUM('None', 'Tradable Goods', 'Shipping') NOT NULL, `price` INT(7) NOT NULL, `cost` INT(7) NOT NULL, `rrp_show` ENUM('N', 'Y') NOT NULL, `rrp` INT(7) NOT NULL, `sprice_show` ENUM('N', 'Y') NOT NULL, `sprice` INT(7) NOT NULL, `short_description` TEXT NOT NULL, `long_description` TEXT NOT NULL, `keywords` VARCHAR(255) NOT NULL, `image1_label` VARCHAR(255) NOT NULL, `image1_link` VARCHAR(255) NOT NULL, `image2_label` VARCHAR(255) NOT NULL, `image2_link` VARCHAR(255) NOT NULL, `image3_label` VARCHAR(255) NOT NULL, `image3_link` VARCHAR(255) NOT NULL, `image4_label` VARCHAR(255) NOT NULL,[...]
MySQL said:
#1071 - Specified key was too long; max key length is 1000 bytes
I have read around but have had no luck so far. I will attach a pdf showing the table i am trying to create, and please can anybody shed some light on whats happening?!
Thanks Alex
Attachments:
table.pdf
(29 KB)
(File Type Details)
table
Answer : MYSQL - Specified Key was too long! Help!
No, it's the size of the fields you're trying to make unique. 6 fields times 255 = 1530 characters. If it's UTF-8, the fields could be up to 3 times larger because 1 UTF-8 character can be 3 bytes long. Maybe you could re-examine your data and see if the field sizes can be reduced or if maybe not all of them need to be unique.
Random Solutions
Can I set up a domain workstation offline?
I am trying to load windows xp on a hp g71-340us laptop. The factory installed OS is windows 7 Home Premium. When the set-up disk is loading i get a Stop 0x0000007b BSOD.
Windows NT4 High Encryption Pack
MS Access 2007 Login Form
Scheduled Task Not Getting Scheduled Through Group Policy
Laptop video not displaying
Use of Excel Macro in MS Access 2000
Calculating a CRC-16
Why Not able to read excel file in the Web application running on Windows7/Office2010?