导出csv
select * from test_info
into outfile ‘/tmp/test.csv’
fields terminated by ‘,’ optionally enclosed by ‘”‘ escaped by ‘”‘
lines terminated by ‘\n’;
导入csv
…
导出csv
select * from test_info
into outfile ‘/tmp/test.csv’
fields terminated by ‘,’ optionally enclosed by ‘”‘ escaped by ‘”‘
lines terminated by ‘\n’;
导入csv
…
MySQL字符集设置
• 系统变量:
– character_set_server:默认的内部操作字符集
– character_set_client:客户端来源数据使用的字符集
– character_set_connection:连接层字符集
– character_set_results:查询结果字符集
– character_set_database:当前选中数据库的默认字…
[root@sun ~]# mysqlimport –fields-terminated-by=, –lines-terminated-by=\n ziliao ./a.csv
mysqlimport: Error: 13, Can’t get stat of ‘/var/lib/mysql/a.csv’ (Errcode: 2), when using table: a
缺少一个参数 …