Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question

3 Answers 3

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.

share|improve this answer
    
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 –  Whitey Jan 18 '12 at 17:43
    
Can you do rpm -qa | grep mysql please? Also, which version of CentOS are you running? –  James Lawrie Jan 18 '12 at 17:51
    
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 :) –  Whitey Jan 18 '12 at 17:58
    
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. –  James Lawrie Jan 18 '12 at 18:04

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

share|improve this answer

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|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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