开发者

export partial mysql meta data, possible?

开发者 https://www.devze.com 2023-02-15 10:15 出处:网络
I want to save some specific records from a database to a file, thus: \"select, export etc\" * from tbl1 where ClientName = \'DemoAccount\';

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

精彩评论

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