https://github.com/avil13/my-dumper
A simple utility for creating mysql dumps.
https://github.com/avil13/my-dumper
dump dumper go golang mysql
Last synced: 3 months ago
JSON representation
A simple utility for creating mysql dumps.
- Host: GitHub
- URL: https://github.com/avil13/my-dumper
- Owner: avil13
- Created: 2018-12-26T02:11:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-27T23:38:55.000Z (over 6 years ago)
- Last Synced: 2024-10-11T17:18:25.483Z (8 months ago)
- Topics: dump, dumper, go, golang, mysql
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# My DB Dumper
## A simple utility for creating mysql dumps.
> wip
> Just 4 fun
### Is able to:
- Dump the database with the time of creation of the file in the title
- Separates table creation files and data insertion files
- Execute SQL data from files
- Ignores the dump tables specified in the config
- Uses `.env` file to set up environment## Create dump
```bash
$ ./dmpr
```## Execute SQL data from files
```bash
$ ./dmpr -import path/to/file.sql
```## `.env` config
For create exemple .env file
```bash
$ ./dmpr -make-env
```### env parameters
.env param | required | example | description
|--- |--- |---|---|
TITLE | true | example.com |
DB_HOST | true | mysql |
DB_PORT | true | 3306 |
DB_DATABASE | true | homestead |
DB_USERNAME | true | homestead |
DB_PASSWORD | true | secret |
DUMP_CREATE | true | true | create tables file
DUMP_INSERT | true | true | insert data file
DUMP_DIR | false | dumps | Folder for dump
IGNORE_TABLES | false | peoples\|likes | if you want to ignore some tables, specify them with the symbol \|
DEBUG | false | false | for debugging the file names do not contain the creation date
LOG | false | true | Create a file logging errors
LOG_ERROR_FILE | false | error.log | filename error log### flags
```bash
$ ./dmpr -make-env # create .env file
``````bash
$ ./dmpr -all # Ignore .env parameters DUMP_CREATE and DUMP_INSERT
``````bash
$ ./dmpr -import path/to/file.sql # Execute sql file
``````bash
$ ./dmpr -help
Usage of ./dmpr:
-all
create all dump files
-import string
import dump file
-make-env
create .env boilerplate file
```### example of a generated file
```bash
$ tree .
.
├── dmpr
└── dumps
└── 2018-12-27
└── 2018-12-27_03:57_insert.sql```