还原 -- 创建数据库 CREATE DATABASE dbname DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
-- 还原数据库 mysql -uroot -p123456 dbname < /path/dbname.sql
-- 还原数据库 source dbname.sql --phpfensi.com -- 查看表结构 desc wp_users; show create table wp_users /G; SELECT INTO OUTFILE导出 SELECT * INTO OUTFILE 'temp.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '/n' FROM table_name WHERE createtime < 1382716800; LOAD DATA 导入
LOAD DATA INFILE '/home/temp.txt' INTO TABLE table_name FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '/n' (product_id,uuid,mac,monitor,win_version,ip,createtime) ; 注:从本地导入远程服务器需使用LOAD DATA LOCAL INFILE
确保local_infile打开且有权限的情况下LOAD DATA若报错:message:The used command is not allowed with this MySQL version