How to install MySQL 5.7 on CentOS 7 Server
To install MySQL 5.7 on CentOS 7 server, install the repository
1 |
rpm -ivh http://repo.mysql.com/mysql57-community-release-el7.rpm |
import MySQL GPG key with
1 |
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 |
Install MySQL with the command
1 |
yum install mysql-community-server.x86_64 |
Enable MySQL to start on boot
1 |
systemctl enable mysqld |
Start MySQL with
1 |
systemctl start mysqld |
Find the initial MySQL password with the command
1 |
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
1 |
mysql_secure_installation |