This script creates a MySQL applicantion from a docker image. You can persist your mysql and customize your mysql without expertise in Docker.
npm install -g @usdocker/usdocker # Install it first
npm install -g @usdocker/mysql
usdocker -r # Update USDocker database
usdocker mysql up
usdocker mysql down
usdocker mysql status
usdocker mysql client -- [args]
Example:
usdocker mysql client -- -u root -p
usdocker mysql connect -- [args]
usdocker mysql dump -- [database]
usdocker mysql analyse
You can setup the variables by using:
usdocker mysql --set variable=value
Default values
- image: "mysql:5.7",
- folder: "$HOME/.usdocker/data/mysql",
- port: 3306,
- rootPassword: "password" (note: only will work at the first time)
Use your own setup for mysql changing this file.
[mysqld]
bind-address = 0.0.0.0
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
This folder exists for setup the database dump. You have only edit the file .my.cnf with the following setup:
[mysqldump]
user=backup
password=PasSWord