MySQL
docker

Docker内でMySQLを動かす

This is how we setup docker
dockerのセットアップは、こちらを見て下さい

bash
sudo docker run --privileged -d --name mysql-server centos /sbin/init
bash
sudo docker exec -it mysql-server /bin/bash

inside container

bash
yum -y localinstall https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
bash
yum -y install mysql-community-server

You can check a MySQL version

bash
mysqld --version
#mysqld  Ver 5.7.19 for Linux on x86_64 (MySQL Community Server (GPL)

You can run MySQL

bash
systemctl start mysqld.service

You can check it

bash
ps -ef | grep mysqld
#/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

You can check a password

bash
cat /var/log/mysqld.log | grep root
#2017-08-08T10:43:04.940429Z 1 [Note] A temporary password is generated for root@localhost: FFETsYVzj8+s

You must set a new password

bash
mysql_secure_installation