How To Install MySQL Server on CentOS 7


In this tutorial we will show you how to install and configuration of MySQL on your CentOS 7 server. For those of you who didn’t know, MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. The MySQL source code is freely available because it was originally developed as freeware. MySQL is written in C and C++ and is compatible with all major operating systems. MySQL can be used for a variety of applications, but is most commonly found on Web servers.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation MySQL server in CentOS 7 server.

Install MySQL Server on CentOS 7

Step 1. First, you need to enable repository package of MySQL on your system.

Step 2. Install MySQL server.

Installing MySQL is as simple as running just one command:

After that add it to your system startup and start the MySQL server using the following commands:

Step 3. Configuring MySQL.

By default, MariaDB is not hardened. You can secure MySQL/MariaDB using the mysql_secure_installation script. You should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MySQL.

Configure it like this:

Next we will need to log in to the MySQL console and create a database. Run the following command:

Step 4. Configure Firewall for MySQL.

It is highly recommended that the ProfitBricks firewall and/or local Linux firewall be used to restrict access to the MySQL server. Only hosts requiring connectivity to the MySQL server should be granted network access:

Congratulation’s! You have successfully installed MySQL. Thanks for using this tutorial for installing MySQL server in CentOS 7 system. For additional help or useful information, we recommend you to check the official MySQL web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!