Installing MySQL on CentOS 7

So I have finally gotten around to trying out CentOS 7 as a local machine, and I started by doing my normal installs I need for my local development: PHP, MySQL, Modrewrite, etc. But when I went to start MySQL (after not having paid attention to the install messages) I got the error: Failed to issue method call: Unit mysqld.service failed to load: No such file or directory.

It seems CentOS 7 has dropped direct support for MySQL in favor of MariaDB, which is advertised as “An enhanced, drop-in replacement for MySQL.” I will play with it and see, as I have no experience, to-date, with it.

That said, it’s easy to add MySQL direct support into CentOS 7, if you need it.

First, add in the MySQL community repo:

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

Now you can pull a list of the packages available:

yum list available | grep mysql

Gives us:

akonadi-mysql.x86_64                     1.9.2-4.el7                     base
apr-util-mysql.x86_64                    1.5.2-6.el7                     base
dovecot-mysql.x86_64                     1:2.2.10-4.el7_0.1              base
freeradius-mysql.x86_64                  3.0.4-6.el7                     base
libdbi-dbd-mysql.x86_64                  0.8.3-16.el7                    base
mysql-community-bench.x86_64             5.6.25-2.el7                    mysql56-community
mysql-community-client.i686              5.6.25-2.el7                    mysql56-community
mysql-community-client.x86_64            5.6.25-2.el7                    mysql56-community
mysql-community-common.i686              5.6.25-2.el7                    mysql56-community
mysql-community-common.x86_64            5.6.25-2.el7                    mysql56-community
mysql-community-devel.i686               5.6.25-2.el7                    mysql56-community
mysql-community-devel.x86_64             5.6.25-2.el7                    mysql56-community
mysql-community-embedded.i686            5.6.25-2.el7                    mysql56-community
mysql-community-embedded.x86_64          5.6.25-2.el7                    mysql56-community
mysql-community-embedded-devel.i686      5.6.25-2.el7                    mysql56-community
mysql-community-embedded-devel.x86_64    5.6.25-2.el7                    mysql56-community
mysql-community-libs.i686                5.6.25-2.el7                    mysql56-community
mysql-community-libs.x86_64              5.6.25-2.el7                    mysql56-community
mysql-community-server.x86_64            5.6.25-2.el7                    mysql56-community
mysql-community-test.x86_64              5.6.25-2.el7                    mysql56-community
mysql-connector-java.noarch              1:5.1.25-3.el7                  base
mysql-connector-odbc.x86_64              5.3.4-1.el7                     mysql-connectors-community
mysql-connector-python.noarch            2.0.4-1.el7                     mysql-connectors-community
mysql-utilities.noarch                   1.5.4-1.el7                     mysql-tools-community
mysql-utilities-extra.noarch             1.5.4-1.el7                     mysql-tools-community
mysql-workbench-community.x86_64         6.3.4-1.el7                     mysql-tools-community
mysql-workbench-community-debuginfo.x86_64
                                         6.3.4-1.el7                     mysql-tools-community
php-mysqlnd.x86_64                       5.4.16-36.el7_1                 updates
qt-mysql.i686                            1:4.8.5-8.el7                   base
qt-mysql.x86_64                          1:4.8.5-8.el7                   base
redland-mysql.x86_64                     1.0.16-6.el7                    base
rsyslog-mysql.x86_64                     7.4.7-7.el7_0                   base

From there, I can install the various packages I may need:

yum install mysql-community-common mysql-community-devel mysql-community-server

Hope that helps!

Posted in Linux Tagged with: , ,