先更改表的
在改字段
alter table userinfo change sex sex varchar(50) charset utf8;
show create table userinfo;
CREATE TABLE `userinfo` (
`id` int(11) NOT NULL,
`sex` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`phone` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`email` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`address` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`department` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`station` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`permission` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
alter table userinfo change sex sex varchar(50) charset utf8;
CREATE TABLE `userinfo` (
`id` int(11) NOT NULL,
`sex` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
`phone` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`email` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`address` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`department` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`station` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
`permission` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin