编一PHP程序,先列所有表名,再将每一数据表中的数据变为标准的sql语句(insert into xxtable (fd1,fd2....) values(v1,v2...)
就和mysqldump所做的一样,然后将生成的文件(可按日期生成文件名)下载下来即可(网速不快的还可以远程压缩一下)。
就和mysqldump所做的一样,然后将生成的文件(可按日期生成文件名)下载下来即可(网速不快的还可以远程压缩一下)。
只要你能有相关的权限,如Insert,Select你可以将查询到的结果保存为SQL语句,
然后就将它转为Insert要恢复到数据库中,就执行它,
如果你没有远速连接MySQL的权限,
你只能用PHP编写相关的代码,呵呵,
有问题再问吧,
有事不能多说了
看看有什么启发
#
# MySQL Dump
#---------------------------------------------#
# 选择 mysql 数据库
#USE mysql;#
# Dumping data for table "columns_priv"
##
# Dumping data for table "db"
#INSERT INTO db VALUES("localhost","catv","Guest","Y","N","N","N","N","N","N","N","N","N");
#
# Dumping data for table "func"
##
# Dumping data for table "host"
##
# Dumping data for table "tables_priv"
##
# Dumping data for table "user"
#INSERT INTO user VALUES("localhost","root","","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y");
INSERT INTO user VALUES("%","root","","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y");
INSERT INTO user VALUES("localhost","card","","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y");
INSERT INTO user VALUES("localhost","Guest","","N","N","N","N","N","N","N","N","N","N","N","N","N","N");
BACKUP TABLE tbl_name[,tbl_name...] TO '/path/to/backup/directory'
Make a copy of all the table les to the backup directory that are the minimum needed
to restore it. Currenlty only works for MyISAM tables. For MyISAM table, copies .frm
(denition) and .MYD (data) les. The index le can be rebuilt from those two.
Before using this command, please see See Section 4.4.1 [Backup], page 206.
During the backup, read lock will be held for each table, one at time, as they are being
backed up. If you want to backup several tables as a snapshot, you must rst issue LOCK
TABLES obtaining a read lock for each table in the group.
The command returns a table with the following columns:
Column Value
Table Table name
Op Always \backup"
208 MySQL Technical Reference for Version 4.0.1-alpha
Msg type One of status, error, info or warning.
Msg text The message.
Note that BACKUP TABLE is only available in MySQL version 3.23.25 and later.
当然还有更快的方法,就是在PHP中调用系统的命令(mysqldump),让mysqldump完成后,再用zip将其压缩,生成的结果显示出来,不过这要求PHP程序有较高的用户权限,但一般的商业网点是不会开放这些权限的,除非是系统管理员忘记了将exec的权限封锁,你可以在你的空间上试一下。