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
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
Leave a Reply