我想将一些特定记录从数据库保存到文件中,因此:
"select, export etc" * from tbl1 where ClientName = 'DemoAccount';
应生成输出
insert into tbl1 ...
这是否可能没有生成请求结果的脚本?
如果没有,任何适当的php-class知识?
:编辑:
体面的解决方案,(sql prefeered虽然..):
backup:
select * from tbl1 where ClientName='DemoAccount' into outfile '/opt/demo.sql'
restore:
delete from tbl1 where ClientName='DemoAccount';
LOAD DATA INFILE '/opt/mysql.sql' into table tbl1;
的问候, //吨
答案 0 :(得分:3)
您可以将mysqldump与--where
(或-w
)选项一起使用,该选项允许您指定WHERE子句。
mysqldump -w "ClientName = 'DemoAccount'" ...other options...