How to install MySQL 5.7 on CentOS 7 Server

To install MySQL 5.7 on CentOS 7 server, install the repository

rpm -ivh http://repo.mysql.com/mysql57-community-release-el7.rpm

import MySQL GPG key with

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

Install MySQL with the command

Advertisement

yum install mysql-community-server.x86_64

Enable MySQL to start on boot

systemctl enable mysqld

Start MySQL with

systemctl start mysqld

Find the initial MySQL password with the command

grep 'password' /var/log/mysqld.log

This initial password is expired, you should change this password before you can start using MySQL server.

To set MySQL password and secure MySQL server, run the command

mysql_secure_installation
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement