wordpress 笑话站,公司网站建设案例,做推广哪个网站效果好,wordpress建电影网站将文本内容导入mysql数据库中导入语句加入字符集#xff0c;否则乱码
character set gbk;因为name列加了唯一索列#xff0c;加这个是为避免重复数据插入报错
ignore into table把相同的先删除掉
replace into table[linux]
这里关键load data infile /tmp/t0.txt ignore int… 将文本内容导入mysql数据库中导入语句加入字符集否则乱码
character set gbk;因为name列加了唯一索列加这个是为避免重复数据插入报错
ignore into table把相同的先删除掉
replace into table[linux]
这里关键load data infile /tmp/t0.txt ignore into table t0
character set gbk fields terminated by ,
enclosed by lines terminated by \n (name,age,description);[windows]
load data infile f:/2.txt ignore into table t0character set gbk fields terminated by ,
enclosed by lines terminated by \r\n (name,age,description);CREATE TABLE t0 (id bigint(20) unsigned NOT NULL auto_increment,name char(20) NOT NULL,age tinyint(3) unsigned NOT NULL,description text NOT NULL,PRIMARY KEY (id),UNIQUE KEY idx_name (name)
) ENGINEMyISAM DEFAULT CHARSETgbk;导入的文件
2.txt我爱你1,201,相貌平常经常耍流氓哈哈
我爱你2,202,相貌平常经常耍流氓哈哈
我爱你3,203,相貌平常经常耍流氓哈哈
我爱你4,204,相貌平常经常耍流氓哈哈 转载于:https://www.cnblogs.com/kaka100/archive/2013/03/07/2947337.html