如何归档 MySQL 数据库?

发布于 2024-07-09 21:06:07 字数 317 浏览 5 评论 0原文

我有一个想要存档的 MySQL 数据库。 做这个的最好方式是什么?

注意:我不想只想进行备份。 我想一次性导出数据以供长期存储,以便以后可以使用。 特别是,我不想被 MySQL、数据库或最好是任何给定的软件所束缚(我真的希望编写一个可以读回它的程序很简单,比如几十行 C 或 perl) 。

我当前的计划是使用 CSV 引擎将内容转储到表中,然后将其刻录到 DVD。 这很好,因为 CSV 可以由许多不同的程序加载。 唯一的问题是大部分数据都在 Blob 列中,就像二进制一样,所以我需要解码它的编码方式。

I have a MySQL database that I want to archive. What is the best way to do this?

Note: I don't want to just do a backup. I want to do a one time export of the data for long term storage in a way that I can get at on a later date. Particularly, I want to not be tied to MySQL, a database or preferably any given software (I'd really like it to be trivial to wright a program that can read it back in, something like a few dozen lines of C or perl).

My current plan is to dump stuff to a table using the CSV engine and then burn that to DVD. The is nice because CSV can be loaded by so many different programs. The only gotcha in this is that the bulk of the data is in Blob columns as in binary so I'll need to decode how that is encoded.

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

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

发布评论

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

评论(3

恋竹姑娘 2024-07-16 21:06:07

导出为 CSV、使用 Base64 编码对二进制数据进行编码,然后使用 gzip 进行压缩听起来是一个不错的方法。 不过,我建议您仔细考虑一下 DVD 的选择。 可记录介质多年来往往会迅速恶化。

Exporting to CSV, encoding binary data with Base64 encoding, and then compressing with gzip sounds like a good way to go. I'd advise you to think well about your choice of DVDs though. Recordable media tends to deteriorate rapidly over the years.

微暖i 2024-07-16 21:06:07

您可以将整个数据库转储到 .sql 文件中,并使用 VCS 来存档每个版本。 如果您需要旧版本,可以将其从存储库中导出并从中恢复。

You could dump the entire DB into a .sql file and use a VCS to archive each version. If you needed an old version, you could export it out of the repository and restore from it.

凉墨 2024-07-16 21:06:07
mysql> ALTER TABLE arch2 ENGINE='ARCHIVE';

在此处输入图像描述

mysql> ALTER TABLE arch2 ENGINE='ARCHIVE';

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文