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
link|improve this question
feedback

3 Answers

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.

link|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 at 17:43
Can you do rpm -qa | grep mysql please? Also, which version of CentOS are you running? – James Lawrie Jan 18 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 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 at 18:04
feedback

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

link|improve this answer
feedback

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/

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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