Home > Database > Mysql Tutorial > body text

互联网创业的准备数据备份_MySQL

WBOY
Release: 2016-06-01 13:48:22
Original
785 people have browsed it

bitsCN.com

只要是创业,即使是很小规模的个人网站微型创业,也要注意数据备份,免得一夜回到过去……

数据出问题的常见原因:误操作导致缺损(无法修复)、服务器临时故障宕机(需等待服务器恢复正常)、服务器故障导入缺损(无法修复)、被入侵。

近期云主机故障如下图,更多故障请参考:http://www.enet.com.cn/article/2012/0730/A20120730142946.shtml

个人网站数据丢失案例:

需要备份的数据:最重要的是代码、数据库、上传的文件(用户头像、产品图片等),其次是软件配置(mysql、apache等)。

代码的备份方法很简单:

使用代码库(svn、git),每次上线之前,在本地测试通过,打tag,提交到代码库,然后上线。

如果服务器故障丢失代码,从代码库里取出最新的tag即可。

单台数据库的备份方法:

如图所示,开发者一般是内网IP,服务器无法直接发送过来,所以服务器crontab定时备份压缩到本机,开发机crontab定时去下载(定时开机即可,不用一直开机)。

crontab mysqldump较为简单,不再详述,请参考:http://www.cnblogs.com/bruceleeliya/archive/2012/05/04/2482733.html

上传的文件:

1台时:crontab定时打包目录,定时下载。

多台时:多个web server同步冗余,无需再单独备份。

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!