恢复 .bz2 Mysql 备份?

发布于 2024-12-25 17:03:50 字数 792 浏览 0 评论 0原文

我尝试对此进行研究,找到了这个网站: http://www .lullabot.com/blog/importexport-large-mysql-databases 仍然很困惑为什么这不能像应有的那样工作。我正在尝试使用数据库将 mysql .bz2 备份从一台服务器恢复到另一台服务器。我运行的命令是:

 bunzip2 SOB-MySQL-backup-summaries_live-2012-01-05.sql.bz2 | mysql -h 192.168.255.53 -u sobuser -p summaries_criticaltest

我在 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

我得到的输出就是这样:bunzip2:输出文件 SOB-MySQL-backup-summaries_live-2012-01 -05.sql已经存在。

我不想转储任何内容,只是将备份 zip 恢复到数据库。我可能做错了,但任何帮助都会很好。谢谢!

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. I'm trying to restore a mysql .bz2 backup from one server to another with the database. 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:

-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.

I'm not trying to dump anything, just restore the backup zip to the database. I may be doing this all wrong but any help would be good. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉城凉梦凉人心 2025-01-01 17:03:50

第一个命令将 SOB-MySQL-backup-summaries_live-2012-01-05.sql.bz2 解压缩为 SOB-MySQL-backup-summaries_live-2012-01-05.sql - 显然这已经发生过一次。

来自 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.

因此,在 | 之前的部分中,您正在寻找以下内容:

bunzip2 -c SOB-MySQL-backup-summaries_live-2012-01-05.sql.bz2 | ...etc...

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.

From man bunzip2 (at your box, or online e.g. at 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...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文