关于如何备份数据库(Mysql)的简易程序
【IT168 服务器学院】在公司(网络)的服务器上有很多网站,我上传网站时对其他瓦干也有同样的权限。所以就想把同事的网站荡下来学习一下。有了源代码,没有数据库什么也运行不了啊。服务器的数据库是安网站开的,每一个网站把*.sql发给服务器管理员,由管理员导入到数据库中。但是数据库账号密码不能登陆只能执行sql语句。所以我就想起来做一个简易的,类似于phpmyadmin的数据库导出功能。这样我就可以轻松的获得所有网站的数据库了。
用这个程序可以实现简单的数据导出(生成的脚本可直接在phpmyadmin执行)。进一步的功能还可以慢慢扩展。当然不要用来盗用别人机密的冬冬了。
其中解析的数据类型还不全,只是集中简单的常用类型。如果那位仁兄,发现了其他不适用的类型,请告诉我mailto:woaini4651@yahoo.com.cn。
index.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>数据库备份</title>
<style type="text/css">
.borderoff{ border-style:none; background-color:#F3F3F3}
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
<tr valign="top">
<td height="378"><br>
<form action="cmd.php" method="post" name="backup" target="_blank" id="backup">
<table width="500" border="0" cellspacing="1" cellpadding="4" align="center">
<tr>
<td colspan="2" align="center">数据库备份</td>
</tr>
<tr bgcolor="#F3F3F3">
<td width="166" align="right"> 服务器名:</td>
<td width="313"><input name="hostname" type="text" class="borderoff" value="localhost" size="35" maxlength="50">
</td>
</tr>
用这个程序可以实现简单的数据导出(生成的脚本可直接在phpmyadmin执行)。进一步的功能还可以慢慢扩展。当然不要用来盗用别人机密的冬冬了。
其中解析的数据类型还不全,只是集中简单的常用类型。如果那位仁兄,发现了其他不适用的类型,请告诉我mailto:woaini4651@yahoo.com.cn。
![]() |
index.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>数据库备份</title>
<style type="text/css">
.borderoff{ border-style:none; background-color:#F3F3F3}
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
<tr valign="top">
<td height="378"><br>
<form action="cmd.php" method="post" name="backup" target="_blank" id="backup">
<table width="500" border="0" cellspacing="1" cellpadding="4" align="center">
<tr>
<td colspan="2" align="center">数据库备份</td>
</tr>
<tr bgcolor="#F3F3F3">
<td width="166" align="right"> 服务器名:</td>
<td width="313"><input name="hostname" type="text" class="borderoff" value="localhost" size="35" maxlength="50">
</td>
</tr>
0
相关文章
