LoginSignup
0
2

More than 5 years have passed since last update.

Docker内でMySQLを動かす

Last updated at Posted at 2017-08-08

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
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2