MySQL is an open-source relational database management system. It is the most popular open-source database in the world. It is commonly deployed as part of the LAMP stack (which stands for Linux, Apache, MySQL, and PHP) .
MySQL community has released MySQL 5.7 Release. Its available on MySQL official website. For this article We are using CentOS 7 AWS instance. For other Operating system version (Like: windows) you may download files from here. Also change the rpm names in all given commands in this tutorial.
This blog post will help you to install MySQL Server 5.7 on your CentOS 6 and Fedora systems.
Enable MySQL Repository
First of all, You need to enable MySQL 5.7 community release yum repository on your system. The rpm packages for yum repository configuration are available on MySQL’s official website.
First of all, import the latest MySQL GPG key to your system.
$ sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
Now, use the below commands to configure the Yum repository as per your operating system version.
$ sudo yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
Installing MySQL 5.7 Server
As you have successfully enabled MySQL yum repository on your system. Now, install MySQL 5.7 community server using the following commands as per your operating system version.
$ sudo yum install mysql-community-server
The above command will install the MySQL community server and other dependencies on your system. During the installation process of packages, a temporary password is created and logged to MySQL log files. Use the following command to find your temporary MySQL password.
MySQL Service Run
After installing RPMs, use the following command to start MySQL Service.
$ sudo systemctl start mysqld
$ sudo systemctl status mysqld
Output● mysqld.service - MySQL 5.7 database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2020-03-12 14:07:41 UTC; 1min 7s ago
Main PID: 15723 (mysqld)
Status: "Server is operational"
Tasks: 38 (limit: 5056)
Memory: 474.2M
CGroup: /system.slice/mysqld.service
└─15723 /usr/libexec/mysqld --basedir=/usr
Mar 12 14:07:32 cent-mysql-3 systemd[1]: Starting MySQL 5.7 database server...
Mar 12 14:07:32 cent-mysql-3 mysql-prepare-db-dir[15639]: Initializing MySQL database
Mar 12 14:07:41 cent-mysql-3 systemd[1]: Started MySQL 5.7 database server.