How to put in MySQL on CentOS 7

How to put in MySQL on CentOS 7


Graphic: Jack Wallen

Chances are you happen to be making use of Linux in its numerous sorts. You may possibly be making use of it to deploy containers, cloud applications, digital devices, or some other incarnation of the open resource system. No matter of how you use Linux, the chance that you’ll count upon a database is relatively superior. And if your deployments will count on a database, MySQL will be a powerful candidate. Ought to your system be CentOS, MySQL is out there for an effortless installation.

I want to stroll you via the procedure of setting up MySQL on CentOS 7, which is slightly unique from setting up on other platforms. I will be demonstrating on the Small model of CentOS 7.

All through the installation of CentOS 7, you can put in the MySQL database server. On the off-likelihood you neglected to do so, the installation is but a couple of fast commands absent.


As soon as you have CentOS 7 up and working, you will have to insert the vital repository with the commands:


Take note: You may possibly have to initially put in wget with the command sudo yum put in wget.

Right after you obtain that file, put in it with the command:

sudo rpm -ivh mysql80-group-release-el7-1.noarch.rpm

Now you can put in the MySQL server with the command:

sudo yum put in mysql-server

The installation should not get considerably time at all. This specific installation is a bit unique from, say, installations on Ubuntu. All through the installation, a random password is established for the root MySQL person. You can discover that password by issuing the command:

much less /var/log/mysqld.log

With that password in hand, you’ll will need to safe the installation by issuing the commands:

sudo mysql_safe_installation

You will be prompted to sort the password for the root person. Style the password you observed in the log file and strike Enter. You can then produce a new password for the MySQL root person and finish up by answering the thoughts for the mysql_safe_installation procedure.

SEE: Securing Linux coverage (Tech Professional Investigate)

Testing the installation

To exam the installation, let’s log into the MySQL prompt. Just situation the command:

mysql -u root -p

When prompted, sort the password you established during the mysql_safe_installation procedure. You must discover on your own at the all-way too-acquainted MySQL prompt (Determine A).

Determine A

Figure A

Your database server awaits your administration.

Ready to go

Congratulations: You now have a functioning MySQL server on the CentOS 7 Small system. You happen to be prepared to begin building databases and making use of them for several deployments.

Also read through…

Your get

Do you have a preferred MySQL idea or trick? Share your advice with fellow TechRepublic users.

Server Install

Proxy Server

Server Install

Leave a Reply

Your email address will not be published.