Install Mysql Database Centos 7

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 http://dev.mysql.com/downloads/repo/yum/

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

wget http://briansnelson.com/stuff/mysql-community-release-el7-5.noarch.rpm
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/multi-user.target.wants/mysqld.service'

Disable MySqL from start on boot

systemctl disable mysqld.service

You should see something like the following:

rm '/etc/systemd/system/multi-user.target.wants/mysqld.service'
rm '/etc/systemd/system/mysql.service'

Start/Stop/Restart MySQL

Start

systemctl start mysqld.service

Stop

systemctl stop mysqld.service

Restart

systemctl restart mysqld.service

Check if MySQL is running

systemctl is-active mysqld.service
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

OpenVPN Tutorial For Debian/Ubuntu on OpenVZ

What is OpenVPN?OpenVPN is a reliable and well tested VPN solution that is able to run over a...

How do I SSH into my VPS? (OS X/Terminal)

If you are on a Mac, SSH-ing into your VPS is very simple. Simply launch "Terminal" by going to...

How do I SSH into my VPS? (Windows/Putty)

This article will teach you how to access your server via SSH using the PuTTY client on Windows....

Install Remi and EPEL yum repo Centos 7

Install Yum EPEL and Remi repositories on Centos 7 Adding additional useful repo's on Centos 6...

Install PHP/PHP-FPM 5.4 Centos 7

Install PHP/PHP-FPM 5.4 on Centos 7 PHP is a server-side scripting language designed for web...