使用shell脚本从MySQL中导入导出数据
#!/bin/bash
echo "
set names utf8;
use mall_test;
select phone,gender from unimall_user where id<=120466;
"|mysql -h8.142.4.65 -uliyongtao -pety%8W%BunLRwV!k > test.txt
echo "
set names utf8;
use mall_test;
load data local infile 'test.txt' ignore into table
test_ce ignore 1 lines (user_name,sex);
"|mysql -h8.142.4.65 -uliyongtao -pety%8W%BunLRwV!k