[英]Restoring a .bz2 Mysql Backup?
I've tried doing my research on this, found this website: http://www.lullabot.com/blog/importexport-large-mysql-databases and still am confused as to why this isn't working like it should. 我已经尝试过对此进行研究,发现这个网站: http : //www.lullabot.com/blog/importexport-large-mysql-databases并且仍然感到困惑,为什么这不应该像它应该的那样工作。 I'm trying to restore a mysql .bz2 backup from one server to another with the database.
我正在尝试使用数据库将mysql .bz2备份从一台服务器恢复到另一台服务器。 The command I'm running to do so is:
我正在运行的命令是:
bunzip2 SOB-MySQL-backup-summaries_live-2012-01-05.sql.bz2 | mysql -h 192.168.255.53 -u sobuser -p summaries_criticaltest
I'm running this in a folder of 2 backup files being: 我在2个备份文件的文件夹中运行它:
-rw-r--r-- 1 root root 19339638 Jan 5 13:50 SOB-MySQL-backup-summaries_dev-2012-01-05.sql.bz2
-rw-r--r-- 1 root root 453 Jan 10 09:45 SOB-MySQL-backup-summaries_live-2012-01-05.sql.bz2
The output I'm getting is just this: bunzip2: Output file SOB-MySQL-backup-summaries_live-2012-01-05.sql already exists. 我得到的输出就是这样:bunzip2:输出文件SOB-MySQL-backup-summaries_live-2012-01-05.sql已经存在。
I'm not trying to dump anything, just restore the backup zip to the database. 我不是要尝试转储任何内容,只需将备份zip恢复到数据库即可。 I may be doing this all wrong but any help would be good.
我可能做错了,但任何帮助都会很好。 Thanks!
谢谢!
The first command will decompress SOB-MySQL-backup-summaries_live-2012-01-05.sql.bz2 to SOB-MySQL-backup-summaries_live-2012-01-05.sql - and apparently that already happened once. 第一个命令将SOB-MySQL-backup-summaries_live-2012-01-05.sql.bz2解压缩到SOB-MySQL-backup-summaries_live-2012-01-05.sql - 显然已经发生过一次。
From man bunzip2
(at your box, or online eg at http://www.manpagez.com/man/1/bzip2/ ): 来自
man bunzip2
(在你的盒子里,或在线,例如http://www.manpagez.com/man/1/bzip2/ ):
You can also compress or decompress files to the standard output by
giving the -c flag.
So, in the part before the |
所以,在
|
之前的部分 , you're looking for this: ,你在找这个:
bunzip2 -c SOB-MySQL-backup-summaries_live-2012-01-05.sql.bz2 | ...etc...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.