导出部分mysql元数据,可能吗?
我想将数据库中的一些特定记录保存到文件中,因此:
"select, export etc" * from tbl1 where ClientName = 'DemoAccount';
应该生成输出
insert into tbl1 ...
这可能不需要任何脚本生成请求的结果吗?
如果没有,有任何适当的 php-class 知识吗?
:编辑:
不错的解决方案,(尽管首选sql..):
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;
问候, //t
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 tbl1 where ClientName='DemoAccount';
LOAD DATA INFILE '/opt/mysql.sql' into table tbl1;
regards,
//t
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将 mysqldump 与
--where
(或-w
)选项,允许您指定 WHERE 子句。You can use mysqldump with the
--where
(or-w
) option, which allows you to specify a WHERE clause.