`

[转]docker如何简单部署mysql

阅读更多

转自:http://blog.csdn.net/ownfire/article/details/50274335

 

#1    docker pull mysql

#2    docker run -v /data/var/mysql/:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=kS4pJUIb mysql

#3    docker stop [CONTAINER ID]

#4    docker run -it -v /data/var/mysql/:/var/lib/mysql mysql /bin/bash

#5    mysqld_safe&

#6    grant all privileges on *.* to 'wuxiao'@'%' identified by 'password';

#7    docker cp [CONTAINER ID]:/etc/mysql/my.cnf /data/local/my.cnf

#8    docker stop [CONTAINER ID]

#9    docker run -d -p 3306:3306 -v /data/var/mysql/:/var/lib/mysql -v /data/local/my.cnf:/etc/mysql/my.cnf mysql

#10    add [CMD] to  /etc/rc.local

#11    OK!

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics