4

I just installed Apache on my new Digital Ocean Cent OS 7 x64 server. When following Digital Ocean's tutorial, yum cannot install mysql-server.

# yum install mysql mysql-server mysql-libs mysql-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.usinternet.com
 * extras: mirror.cogentco.com
 * updates: mirror.atlanticmetro.net
Package 1:mariadb-5.5.40-2.el7_0.x86_64 already installed and latest version
No package mysql-server available.
Package 1:mariadb-libs-5.5.40-2.el7_0.x86_64 already installed and latest version
No package mysql-server available.
Nothing to do

# service mysqld start
Redirecting to /bin/systemctl start  mysqld.service
Failed to issue method call: Unit mysqld.service failed to load: No such file or directory.

This is my 3rd server setting up mysql, but this one has stumped me.

3 Answers 3

14

In RHEL 7, and consequently in CentOS7, the mysql- packages (or most of them, anyway) have been replaced with mariadb- packages due to an upstream rename/fork. Simply yum install mariadb-server mariadb-libs mariadb and you should be okay - the command names themselves are still mostly mysql related.

3
  • So to manage the mysql-server, I should use service mariadb [command]?
    – User
    Jan 27, 2015 at 16:03
  • service mysql start ... Redirecting to /bin/systemctl start mysql.service Failed to issue method call: Unit mysql.service failed to load: No such file or directory. and service mysqld start ... Redirecting to /bin/systemctl start mysqld.service Failed to issue method call: Unit mysqld.service failed to load: No such file or directory.
    – User
    Jan 27, 2015 at 16:05
  • 2
    Not quite - RHEL/CentOS 7 use the systemctl suite, not the service suite. So yes, you'll be using mariadb as the name, but the command will be systemctl start mariadb.service
    – John
    Jan 27, 2015 at 16:05
5

As answered by John mysql is replaced with mariadb in RHEL 7 and later, but you can still install mysql. Follow the following steps:

  1. Download and add the repository, then update.

    wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
    sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
    yum update

  2. Install MySQL as usual and start the service. During installation, you will be asked if you want to accept the results from the .rpm file’s GPG verification. If no error or mismatch occurs, enter y.

    sudo yum install mysql-server
    sudo systemctl start mysqld

Ref: linode

1

On any RPM based OS you can find which package provides MySQL server:

yum provides "*bin/mysqld"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.