安装好MySQL和Navicat 8 for MySQL 通过Navicat 8 for MySQL创建数据库test. 2 在数据库test上创建测试数据表student(主键ID,姓名,年龄,学号): create table student ( id int not null primary key, name varchar(50) not null, age int, xuehao varchar(20)) 3 创建测试数据txt文件student.txt
mysql --local-infile -uroot -proot task_ops -e "LOAD DATA LOCAL INFILE '/tmp/data_import/app8.csv' INTO TABLE app_infomation FIELDS TERMINATED BY ',' optionally enclosed by '\"' escaped by '\"' LINES TERMINATED BY '\r\n'"
转自: http://codingstandards.iteye.com/blog/604541 MySQL中导出CSV格式数据的SQL语句样本如下: select * from test_info into outfile '/tmp/test.csv' fields terminated by ',' optionally enclosed by '"' escaped by '"' lines terminated by '\r\n'; MySQL中导入CSV格式数据的SQL