Install MySQL on CentOS 7 using yum

gamzatti
Vote 0 Votes

yum remove mariadb-libs
ls /var/lib/mysql/
rpm -qa | grep mariadb
rpm -qa | grep mysql

yum localinstall http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
yum repolist all | grep mysql
yum -y install yum-utils
yum-config-manager --disable mysql57-community
yum-config-manager --enable mysql56-community
yum repolist all | grep mysql
yum info mysql-community-server
yum -y install mysql-community-server
which mysqld
mysqld --version
systemctl status mysqld
systemctl start mysqld
mysqladmin -u root password 'root'

2 Comments

| Leave a comment

In MySQL 5.7, initial setup method has been changed.

Check root initial password.
# cat /var/log/mysqld.log | grep 'temporary password‘
2017-06-18T13:39:33.902255Z 1 [Note] A temporary password is generated for root@localhost: hNY5yEv&%f2-

Change Password using mysql_secure_installation
# mysql_secure_installation

CentOS7 に MySQL をRPMでインストールする

cd /var/tmp

wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-5.6.36-1.el7.x86_64.rpm-bundle.tar

tar xvf MySQL-5.6.36-1.el7.x86_64.rpm-bundle.tar

rpm -Uvh MySQL-server-5.6.36-1.el7.x86_64.rpm

※インストール中以下のメッセージが表示される
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

rpm -Uvh MySQL-client-5.6.36-1.el7.x86_64.rpm

※クライアントを入れないと、mysqlコマンドが使えない

mysql --version
mysql Ver 14.14 Distrib 5.6.36, for Linux (x86_64) using EditLine wrapper

rootの初期パスワードを確認
cat /root/.mysql_secret

mysql -u root -p
初期パスワードでログイン

mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql> SET PASSWORD = PASSWORD('password');


参考)
http://www.kakiro-web.com/linux/mysql-install.html

Leave a comment

About this Entry

This page contains a single entry by gamzatti published on March 1, 2017 8:36 AM.

Dumping table data of mysql was the previous entry in this blog.

Selenium Web Driver for python is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.