Public | Automated Build

Last pushed: 2 years ago
Short Description
Percona MySQL for NiceScale, support connect、create database、backup database、shutdown gracefully etc. http://nicescale.com
Full Description

percona-mysql

percona mysql for nicescale

Build

docker build -t nicescale/percona-mysql .

Run

. path.ini
docker run -d -v $HOME/data:$data -v $HOME/log:$log nicescale/percona-mysql

Create Database

. path.ini
docker run --rm -v $HOME/data:$data -e DBNAME=dbtest -e DBUSER=dbtest_user -e DBPASS=123qwe nicescale/percona-mysql /opt/nicedocker/create_db.sh

If you need to automate your work, you can create database like this:

docker run --rm -v $HOME/data:$data -e DBNAME=dbtest -e DBUSER=dbtest_user -e DBPASS=123qwe nicescale/percona-mysql /opt/nicedocker/wait.sh /opt/nicedocker/create_db.sh

Script wait.sh will execute create_db.sh until mysqld be ready.

Connect Database

. path
docker run --rm -it -v $HOME/data:$data nicescale/percona-mysql mysql

Execute Sql

. path
docker run --rm -v $HOME/data:$data nicescale/percona-mysql mysql -e "select count(*) from dbtest.testtable"

Backup Database

. path
docker run --rm -v $HOME/data:$data -v $HOME/backup:/backup nicescale/percona-mysql sh -c "mysqldump dbtest > /backup/dbtest"

Shutdown Database

. path
docker run --rm -v $HOME/data:$data nicescale/percona-mysql mysqladmin --no-defaults shutdown
Docker Pull Command
Owner
nicescale
Source Repository