I am new to mysql so I am using phpmyadmin to create table in database. I have field Manufacturer of enum type with possible values "manufacturer1", "manufacturer2", ...
I chose ENUM type and clicked on "Edit ENUM/SET values" and a window pop up asking for desired values. I fallow the instructions, press "go" and 'Manufacturer1','Manufacturer2','Manufacturer3','Manufacturer4' is no written in Length/Values.
When I try to create table I get 1064 syntax error. When I click on "Preview SQL" I get this:
CREATE TABLE `test4_db`.`product` ( `product_id` INT(11) NOT NULL AUTO_INCREMENT , `image_url` VARCHAR(255) NOT NULL , `manufacturer` ENUM(0) NOT NULL DEFAULT 'Manufacturer1' , `health` ENUM(0) NOT NULL , `missing` INT(11) NOT NULL , `statuss` ENUM(0) NOT NULL DEFAULT 'available' , `owner_id` INT(11) NOT NULL , `holder_id` INT(11) NOT NULL , PRIMARY KEY (`puzzle_id`)) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_bin;
Why does phpmyadmin writes ENUM(0) instead of ENUM('Manufacturer1','Manufacturer2','Manufacturer3','Manufacturer4')?
This is a bug with phpMyAdmin 4.6.4.
See this - https://github.com/phpmyadmin/phpmyadmin/issues/12480
This will be fixed in 4.6.5.
In the meanwhile, you can simply do "Preview SQL", copy the SQL generated, and replace ENUM(0) with the values you want.
Alternatively, use a previous version of phpMyAdmin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With