Giter VIP home page Giter VIP logo

bash-mysql-helper's Introduction

mysql-helper

Import, export and make backups of MySQL/MariaDB databases.

Installing

Easy with Basher

basher install nelson6e65/bash-mysql-helper

Done!

Configuring

mysql-helper uses a .env file to read database credentials.

Example of a .env file content:

# Optional
DB_HOST='localhost'
DB_PORT=3306

# Mandatory
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=

# Other stuffs not used by `mysql-helper`...

Usage

Backup Database

It creates a backup file: {database}_{date}.sql.gz file.

mysql-helper b
mysql-helper backup

You can ignore backup creation by using --no-backup

Exporting Database to SQL

Exports DB to {database}.sql file.

mysql-helper e
mysql-helper export
# mysql-helper -e # DEPRECATED
# mysql-helper --export # DEPRECATED

Importing SQL to Database

Import a database content from {database}.sql file.

mysql-helper i
mysql-helper import
# mysql-helper -i # DEPRECATED
# mysql-helper --import # DEPRECATED

Note: By default it will run backup automatically. To avoid this, pass --no-auto-backup.

Customize target dir

By default, it will use the working directory to search files. In order to use a different target-dir:

mysql-helper (i|e|b) <target-dir>
mysql-helper (i|e|b) --target <target-dir> # DEPRECATED

More options

Use --help to see more options.

mysql-helper --help

Credits

Some tools used:

bash-mysql-helper's People

Contributors

nelson6e65 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.