为备份目的“即时”创建SQL字符串 [英] creating SQL string 'on-the-fly' for backups purposes

查看:48
本文介绍了为备份目的“即时”创建SQL字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我最近使用了一个系统(oscommerce商店),您可以在其中备份数据库
。当你点击''备份数据库''时,会发生这样的事情:

它会创建一个SQL字符串,将它存储在一个文本文件中然后让你把它b / b
下载到你的硬盘中驱动。


是否有一种创建此SQL文件的简单方法?如果没有,是否有任何可用于任何数据库/表的免费脚本

创建一个SQL字符串存储在文本文件中?

,你如何(一旦创建了SQL文件)然后提示

用户将文件保存到他们的计算机上?欢呼


burnsy



i have recently used a system (oscommerce store) where you can backup
your database. what happens is that when you click ''backup database'',
it creates an SQL string, stores it in a text file and lets you
download it to your hard drive.

is there a simple means of creating this SQL file? if not, are there
any free scripts available that can be used on any database/table and
create a SQL string to be stored in a text file?

also, how do you (once the SQL file has been created) then prompt the
user to save the file onto their computer? cheers

burnsy

推荐答案

2004年7月20日06:45:20 -0700
bi******@yahoo.co.uk (mr_burns)写道:
On 20 Jul 2004 06:45:20 -0700
bi******@yahoo.co.uk (mr_burns) wrote:


我最近使用了一个系统(oscommerce商店),您可以在其中备份您的数据库。当你点击''备份数据库''时,它会创建一个SQL字符串,将其存储在一个文本文件中,然后让你将它下载到硬盘上。
创建一个SQL字符串存储在文本文件中?

如何你(一旦创建了SQL文件)然后提示
用户将文件保存到他们的计算机上?欢呼


i have recently used a system (oscommerce store) where you can backup
your database. what happens is that when you click ''backup database'',
it creates an SQL string, stores it in a text file and lets you
download it to your hard drive.

is there a simple means of creating this SQL file? if not, are there
any free scripts available that can be used on any database/table and
create a SQL string to be stored in a text file?

also, how do you (once the SQL file has been created) then prompt the
user to save the file onto their computer? cheers




简单。

如果你在* nix系统上,你可以使用shell-commandmysqldump<转储内容并强制下载文件的
只是一个简单的http-header。


示例:转储数据库"试验"并提供下载。

<?php

//数据库的用户名和密码



Simple.
If you''re on a *nix system, you can use the shell-command "mysqldump"
for dumping the content and forcing a download of the file is just a
simple http-header.

Example: Dump database "test" and offer download.
<?php
// username and password for the database


db_user =" ; someuser" ;;
db_user = "someuser";


db_pass =" somepass";
db_pass = "somepass";


这篇关于为备份目的“即时”创建SQL字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆