#mysql #backup #applications #command-line #exclude #backing

app rust_mysqldump

A command-line application for quickly backing up your MySQL databases

2 releases

0.1.1 Nov 30, 2023
0.1.0 Nov 27, 2023

#743 in Database interfaces

47 downloads per month

MIT license

20KB
193 lines

Rust MySQL Dump 🚀

Build License: MIT Crates.io Crates.io

Rust MySQL Dump is a command-line application for quickly backing up your MySQL databases. It supports exporting multiple databases in a single operation, runs asynchronously and is extremely fast. Outputs export information as each operation completes. Tested on moderate to large size databases without any problems.

Features

  • Export all your databases in a single operation.
  • Runs asynchronously and is extremely fast.
  • Exclude selected databases from the backup.
  • Prints exported database list in a colorized table.

Usage

  1. Set the following environment variables:

    • DB_HOST: The hostname of your MySQL server.
    • DB_PORT: The port number of your MySQL server.
    • DB_USERNAME: The username to use when connecting to your MySQL server.
    • DB_PASSWORD: The password to use when connecting to your MySQL server.
    • DB_EXPORTS: A comma-separated list of databases to backup. Use * to backup all databases.
    • DB_FORGETS: A comma-separated list of databases to exclude from the backup.
  2. Run the application:

    cargo run
    

Dependencies

This utility depends on the following Rust crates:

  • mysql: To connect to the MySQL server and retrieve the list of databases.
  • cli-table: To print the list of databases in a neat table.
  • colored: To colorize the output to the terminal.
  • dotenv: To load the database configuration from environment variables.
  • serde: To deserialize the database configuration.

Contributing

Contributions are welcome! Please submit a pull request or create an issue on GitHub.

License

The MIT License (MIT). See License File for more information.

Dependencies

~21–37MB
~570K SLoC