Last active
October 2, 2019 10:35
-
-
Save binarycat0/3fe1a4002e670f5391a9a3a09bf9ecd8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create data dirs | |
mkdir -p /mysql/data/db | |
mkdir -p /mysql/conf | |
# customizing mysql instance | |
echo [mysqld] > /mysql/conf/custom_options.cnf | |
echo innodb_buffer_pool_size=100M >> /mysql/conf/custom_options.cnf | |
# run mysql image | |
docker run -d --name mysql-db \ | |
-e MYSQL_RANDOM_ROOT_PASSWORD=yes \ | |
-e MYSQL_DATABASE=db \ | |
-e MYSQL_USER=db \ | |
-e MYSQL_PASSWORD=bgt765rtyfgvh \ | |
-v "/mysql/data/db:/var/lib/mysql" \ | |
-v "/mysql/conf:/etc/mysql/conf.d" \ | |
-p 127.0.0.1:33061:3306 \ | |
mysql:5 | |
# check | |
mysql -h 127.0.0.1 -P 33061 -u db -p db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment