MySQL(5)-docker中安装和使用

#yum install docker-engine

# useradd docker

docker$ docker pull wonder4/centos

$docker run -it wonder4/centos

root# yum install sudo

root# useradd mysql

root# visudo  增加mysql

docker$ docker ps -l

获得container id前四位93e7

docker$ docker commit 93e7 wonder4/mysql   保存到mysql

docker$ docker run -it wonder4/mysql

root# su - mysql

mysql$ sudo yum -y libaio

mysql$ sudo yum -y update

mysql$ sudo yum -y erase mariadb mariadb-server

mysql$ sudo yum install wget -y
wget http://dev/mysql.com/get/mysql-community-release-el7-7.noarch.rpm

sudo rpm -ivh mysql57-community-release-el7-7.noarch.rpm

sudo yum install mysql-community-server 

或者使用源码安装

---------------------------------

docker中执行service mysql start报错,service没找到

因为精简安装,可以使用

#yum install initscripts

你可能感兴趣的:(MySQL(5)-docker中安装和使用)