日期:2014-05-16  浏览次数:20659 次

创建数据库
CREATE DATABASE sss DEFAULT CHARACTER SET=UTF8;
USE ss;
create table classes_number (id bigint not null, class_name varchar(255), starttime varchar(255), endtime varchar(255), 

greeting varchar(255), primary key (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into classes_number values(1,'早班','09:00','09:20','早上好');
insert into classes_number values(2,'中班','02:00','02:20','中午好');
insert into classes_number values(3,'早班','06:00','06:20','晚上好');
批处理为什么会有乱码

------解决方案--------------------
set names 'gbk';

然后再处理。
------解决方案--------------------
先把字符集设为一致,set names CHARACTER
------解决方案--------------------
set names gbk;
insert into classes_number values(1,'早班','09:00','09:20','早上好');
insert into classes_number values(2,'中班','02:00','02:20','中午好');
insert into classes_number values(3,'早班','06:00','06:20','晚上好');