티스토리 뷰

Install / Configuration / Run MySQL 5.6.x in CentOS7 On Docker

Install

Download mysql rpm package and Install rpm repositories by using rpm command:

[]# yum install wget
[]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
[]# rpm -ivh mysql-community-release-el7-5.noarch.rpm

Check mysql repositories:

[]# ls -1 /etc/yum.repos.d/mysql-community*
/etc/yum.repos.d/mysql-community.repo
/etc/yum.repos.d/mysql-community-source.repo

Installing MySQL Server:

[]# yum install mysql-server

Installing databases to MySQL Server:

[]# mysql_install_db --user=mysql

Configuration root password:

type 1:

[]# /usr/bin/mysqladmin -u root password 'new-password'
[]# /usr/bin/mysqladmin -u root -h 'hostname' password 'new-password'

alternatively type 2:

[]# /usr/bin/mysql_secure_installation

manual start MySQL daemon:

[]# cd /usr ; /usr/bin/mysqld_safe &

test the MySQL daemon:

[]# cd mysql-test; perl mysql-test-run.pl