开发者

export partial mysql meta data, possible?

I want to save some specific records from a database to a file, thus:

"select, export etc" * from tbl1 where ClientName = 'DemoAccount';

should generate output

insert into tbl1 ...

Is this possible w/o any script generating the requested result?

if not, any knowledge of appropriate php-class?

:edit:

decent solution, (sql prefeered though..):

backup:
select * from tbl1 where ClientName='DemoAccount' into outfile '/opt/demo.sql'

restore:
delete from开发者_JS百科 tbl1 where ClientName='DemoAccount';
LOAD DATA INFILE '/opt/mysql.sql' into table tbl1;

regards, //t


You can use mysqldump with the --where (or -w) option, which allows you to specify a WHERE clause.

mysqldump -w "ClientName = 'DemoAccount'" ...other options...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜