Installing MySQL on CentOS

5,397

Solution 1

Check out yum provides "*/mysql" to find out which package provides a file in future, but the package is just called mysql in CentOS, so yum install mysql.

Solution 2

The package mysql-server is for the server part, mysql for the mysql client application and mysql-libs for shared libraries.

Solution 3

Try,

"yum install mysql-server mysql"

Or try to download the rpm from the site and install [1]

[1] http://www.mysql.com/downloads/mysql/

Share:
5,397

Related videos on Youtube

Whitey
Author by

Whitey

Updated on September 18, 2022

Comments

  • Whitey
    Whitey over 1 year

    I have set up a nginx server running php-fpm and everything is working great. PHP is compiled with the mysql and mysqli extensions, but I'm having trouble installing MySQL. I did this command:

    yum install mysql-server mysql-client
    

    and it only installed mysql-server. it throws this error about mysql-client:

    No package mysql-client available.
    

    Now, I think MySQL is installed properly (since it mananged to install mysql-server), but when I type mysql in the SSH terminal in order to create databases etc I get this:

    -bash: mysql: command not found
    

    Which leads me to believe I need the mysql-client package installed in order to do run commands from the terminal.

    Under /etc/yum.respos.d/ I have:

    CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo
    
  • Whitey
    Whitey over 12 years
    I tried yum install mysql but it said it was already installed. So I removed mysql-server and tried again, and it installed. Now when I run a MySQL command I get this error: mysql: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
  • James L
    James L over 12 years
    Can you do rpm -qa | grep mysql please? Also, which version of CentOS are you running?
  • Whitey
    Whitey over 12 years
    The output of that is:mysql-5.1.52-1.el6_0.1.x86_64 php-mysql-5.3.3-3.el6_2.5.x86_64 mysql-server-5.1.52-1.el6_0.1.x86_64 mysql-libs-5.1.52-1.el6_0.1.x86_64 And I'm running CentOS 6 :)
  • James L
    James L over 12 years
    Ok it looks like that comes from mysql-libs on CentOS 6.*. It should have been installed as a dependency of mysql I think, but yum install mysql-libs should provide you with libmysqlclient.so.16.