in ENUM error Column 'e_sxe' has duplicated value - appears when MySQL create table> 1291 '?'

SQL statement:

create table t_employee(
    e_id int unsigned AUTO_INCREMENT,
    e_num varchar(20) NOT NULL,
    e_name varchar(10) NOT NULL,
    e_sxe ENUM('男','女') NOT NULL,
    e_age int NOT NULL,
    e_tel varchar(11) NOT NULL,
    e_icnumber varchar(20),
    PRIMARY KEY (e_id)
);

An error occurred:

navicat > 1291 - Column 'e_sxe' has duplicated value '?' in ENUM

The problem: the character encoding format is not set.

Correct statement:

create table t_employee(
    e_id int unsigned AUTO_INCREMENT,
    e_num varchar(20) NOT NULL,
    e_name varchar(10) NOT NULL,
    e_sxe ENUM('男','女') NOT NULL,
    e_age int NOT NULL,
    e_tel varchar(11) NOT NULL,
    e_icnumber varchar(20),
    PRIMARY KEY (e_id)
)engine=InnoDB default charset=utf8;

Successfully resolved:

ok !

Published 874 original articles · won praise 1233 · Views 160,000 +

Guess you like

Origin blog.csdn.net/qq_35456045/article/details/105170880