mysql还原另一台服务器上的文件 [英] mysql restore for files on another server

查看:62
本文介绍了mysql还原另一台服务器上的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的测试数据库位于与生产数据库不同的单独远程服务器上.我想不时地通过将生产数据库的副本上载到测试数据库来尝试测试.不幸的是,备份文件现在只有半个演出,我无法通过FTP或SSH传输它.有没有一种简单的方法可以在服务器之间使用mysql restore命令?另外,还有另一种方法可以移动我不考虑​​的大文件吗?半场演出似乎并不大,我想人们会经常遇到这个问题.

I have a test database on a separate remote server than my production DB. Every once in awhile, I want to try and test things by uploading a copy of my production DB to my testing DB. Unfortunately, the backup file is now half a gig and I'm having trouble transferring it via FTP or SSH. Is there an easy way that I can use the mysql restore command between servers? Also, is there another way to move over large files that I'm not considering? Half a gig doesn't seem that big, I would imagine that people run into this issue frequently.

谢谢!

推荐答案

0.请考虑您是否真的需要生产数据(尤其是其中包含一些敏感信息)

0.Please consider whether you really need production data (especially if it contains some sensitive information)

1.最简单的解决方案是在源服务器(通常是gzip)上压缩备份,通过网络传输备份,然后在目标服务器上解压缩.

1.The simplest solution is to compress the backup on the source server (usually gzip), transfer it across the wire, then decompress on the target server.

http://www.techiecorner.com/44/how-to-backup-mysql-database-in-command-line-with-compression/

2.如果不需要生产数据的精确副本(例如,不需要一些应用程序日志,错误和其他技术资料),则可以考虑在源服务器上创建备份并将其还原到其他服务器数据库名称,删除所有不必要的数据,然后备份您将要使用的备份.

2.If you don't need the exact replica of production data (e.g. you don't need some application logs, errors, some other technical stuff) you can consider creating a backup and restore on a source server to a different DB name, delete all unnecessary data and THEN take a backup that you will use.

3.在Dev环境中的参考服务器上一次还原完整备份,然后仅复制事务日志(以在参考服务器上重播它们).根据使用方式的不同,事务日志可能会占用整个数据库更少的空间.

3.Restore full backup once on your reference server in your Dev environment and then copy transaction logs only (to replay them on the reference server). Depending on the usage pattern transaction logs may take a lot less space as the whole database.

这篇关于mysql还原另一台服务器上的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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