码迷,mamicode.com
首页 > 数据库 > 详细

centos7 docker mysql56

时间:2016-07-05 08:48:01      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:

yum -y install docker

docker pull centos

docker run -i -t centos /bin/bash

yum -y install wget

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

rpm -ivh mysql-community-release-el7-5.noarch.rpm

yum -y install mysql-community-server mysql-community-devel

/usr/bin/mysql_install_db  --user=mysql

/usr/bin/mysqld_safe&

/usr/bin/mysql -e "grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘X7898700‘;"

/usr/bin/mysql -e "grant all privileges on *.* to ‘root‘@‘localhost‘ identified by ‘X7898700‘;"

/usr/bin/mysql -u root -pX7898700 -e "show databases;"

exit

docker ps -a

docker commit 6a4e4f55b1e1 mysql56

docker run --name=mysqlserver3307 -t -i -d -p 3307:3306 mysql56 /usr/bin/mysqld_safe

docker start mysqlserver3307 >> /home/logs/mysql3307.log

 

centos7 docker mysql56

标签:

原文地址:http://www.cnblogs.com/fr5s/p/5642250.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!