A terminal window (Menu > Applications > Utilities > Terminal)
The Yum package manager (included by default)
Guide To Installing MySQL on CentOS 7
Step 1: Download the repository packages
Open a browser window, and go to the following address:
This page will list details on the Yum repository that holds the MySQL files. Scroll down to find the Red Hat Enterprise Linux version that you want to download. (At the time of writing, the website offers Linux 7 and Linux 6 – you’ll probably want Linux 7).
You can click the Download button, which takes you to a registration page. You can sign up if you’d like, or look a little lower for the “No thanks, just start my download” link.
Alternately, you can open a terminal and use the wget command to save the file. On the first webpage that lists the release versions, you’ll see a gray subtext that shows something like “(mysql80-community-release-el7-1.noarch.rpm)”.
Make note of this, then open a terminal window, then enter the following command:
The system should reach out and download the files. (Make sure you check the website and copy the exact release ID – use that in your Terminal command.) Leave the browser window open for the next step.
Step 2: Add the Software Repositories
The files we just downloaded provide access to the MySQL software repositories. Before adding them, check the MD5 value to authenticate the software:
The system should respond with a long string of letters and numbers.
Switch back to the MySQL web page and look just below the Download link to find a gray string of numbers labeled MD5.
Compare the MD5 value on the web page to the MD5 value you generated in the terminal window. If they match, proceed to the next step. (If they don’t match, it’s possible that your download was corrupted in transit. Or, it’s possible that the download has been compromised. Repeat Steps 1 and 2 and overwrite the downloaded file. If the MD5 values still don’t match, stop the procedure.
To update the software repositories, use the command:
Make sure you’ve entered the release version from Step 1. This will add 2 new Yum repositories that we can get MySQL from.
Step 3: Install MySQL
Install MySQL on CentOS by entering the following:
sudo yum install mysql-server
The system will ask for confirmation, press Y to confirm.
It should also request that you accept a GPG (Gnu Privacy Guard) key. This is another security confirmation because we just added two new software sources. Press Y again, and the system should download and install the software.
NOTE: MySQL includes several security plugins to authenticate connections to the server, password verification and securing storage for sensitive data. All of these are available in the free version.
Managing MySQL Service
You’ll need to start the MySQL service by entering:
sudo systemctl start mysqld
To check the status of MySQL use the command:
sudo systemctl status mysqld
The system will display several lines of information about the MySQL service. In the Active line, it should display active: (running). You may also see a line below that shows a timestamp of when the service was started.
By default, the MySQL service is set to launch at startup.
To disable it, you can use the disable command:
sudo systemctl disable mysqld
To stop the MySQL service, use the stop command:
sudo systemctl stop mysqld
Find Temporary Password
The MySQL installation routine sets up a default temporary password.
As we know that PHP is the most important part of LAMP applications (WordPress, Joomla, Drupal & Media wiki etc). Now a days most of these applications require PHP 7 for their installation and configuration. Main advantage of PHP 7.x is that it will load your web application faster and will consume less server’s resources like CPU and RAM.
By default, PHP 5.4 is available in CentOS 7 and RHEL 7 yum repositories. In this article we will demonstrate how to install latest version of PHP on CentOS 7 and RHEL 7 Servers.
Installation Steps of PHP 7.0, 7.1 & 7.2 on CentOS 7 Server
1) Install yum-utils and enable EPEL repository
Login to your server and use the below yum command to install yum-utils & enable epel repository