Yum: No package mysql-server available in Cent OS 7

36,172

Solution 1

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.

Solution 2

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

Solution 3

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

yum provides "*bin/mysqld"
Share:
36,172

Related videos on Youtube

User
Author by

User

Internet entrepreneur

Updated on September 18, 2022

Comments

  • User
    User over 1 year

    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.

  • User
    User over 9 years
    So to manage the mysql-server, I should use service mariadb [command]?