Install Mysql Database Centos 7

From Brian Nelson Ramblings
Jump to: navigation, search

Install Mysql Database on Centos 7

MySQL is a popular choice of database for use in web applications, and is a central component of the widely used LAMP open source web application software stack (and other 'AMP' stacks). LAMP is an acronym for "Linux, Apache, MySQL, Perl/PHP/Python." Free-software-open source projects that require a full-featured database management system often use MySQL.

Not yet in the repos list, so I had to download the lastest MySQL yum repo for mysql from

At the time of this article it was mysql-community-release-el7-5.noarch.rpm

Install MySQL repo

You can download that from our server

yum localinstall mysql-community-release-el7-5.noarch.rpm

Install MySQL via Yum

yum install mysql-server mysql

Enable MySQL to start on boot

systemctl enable mysqld.service

You should see something like the following:

ln -s '/usr/lib/systemd/system/mysqld.service' '/etc/systemd/system/mysql.service'
ln -s '/usr/lib/systemd/system/mysqld.service' '/etc/systemd/system/'

Disable MySqL from start on boot

systemctl disable mysqld.service

You should see something like the following:

rm '/etc/systemd/system/'
rm '/etc/systemd/system/mysql.service'

Start/Stop/Restart MySQL


systemctl start mysqld.service


systemctl stop mysqld.service


systemctl restart mysqld.service

Check if MySQL is running

systemctl is-active mysqld.service