eloquent/dumpling

该包已被废弃,不再维护。未建议替代包。

改进界面的Diff-friendly mysqldump。

0.2.2 2014-02-11 12:02 UTC

This package is auto-updated.

Last update: 2020-02-06 04:58:11 UTC


README

改进界面的Diff-friendly mysqldump。

The most recent stable version is 0.2.2 Current build status image Current coverage status image

安装和文档

什么是 Dumpling

Dumpling 是一个对 mysqldump 的包装,使用合理的默认值,并提供了简化的界面。 Dumpling 被设计得尽可能直观和简单易用。

Dumpling 仍然使用 mysqldump 内部,因此 100% 兼容。它还产生比标准 mysqldump 更易于diff的输出。

mysqldump 的问题是什么?

  • 输出内部数据库如 mysqlinformation_schema,这在 99% 的情况下都是无用的(并且在导入时可能存在潜在危险)。
  • 扩展 INSERT 语句的极端行长度会破坏许多文本编辑器。
  • 由于行长度和不可预测的行顺序,扩展 INSERT 语句的 diff 无用。
  • 默认情况下省略了重要过程和函数信息。
  • 命令行界面杂乱无章且缺乏灵活性;数据库和表的包含/排除不一致且有限。
  • 原始二进制数据破坏了可移植性和可读性。
  • 命令行界面使用选项及其值的不标准约定。

Dumpling 使用方法

Usage:
 dumpling [database] [table1] ... [tableN]

Arguments:
 database                The database to dump.
 table                   The table(s) to dump. Expects database.table format.

Options:
 --database (-D)         Additional database(s) to dump. (multiple values allowed)
 --exclude-database (-X) Database(s) to ignore. (multiple values allowed)
 --table (-T)            Additional table(s) to dump. Expects database.table format. (multiple values allowed)
 --exclude-table (-x)    Table(s) to ignore. (multiple values allowed)
 --no-data (-d)          Do not dump table data.
 --host (-H)             The server hostname or IP address. (default: "localhost")
 --port (-P)             The server port. (default: "3306")
 --user (-u)             The user to connect as. (default: "root")
 --password (-p)         The password for the user.
 --help (-h)             Display this help message.
 --version (-V)          Display this application version.

使用示例

以 root 身份无密码导出 localhost

dumpling

排除数据库

dumpling --exclude-database database_a

排除数据

dumpling --no-data

导出一个特定数据库

dumpling database_name

导出一个特定表

dumpling database_name table_name

从不同数据库导出两个特定表

dumpling --table database_a.table --table database_b.table

要求