Installing MySQL on CentOS
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/
Related videos on Youtube
Whitey
Updated on September 18, 2022Comments
-
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 aboutmysql-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 over 12 yearsI tried
yum install mysql
but it said it was already installed. So I removedmysql-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 over 12 yearsCan you do
rpm -qa | grep mysql
please? Also, which version of CentOS are you running? -
Whitey over 12 yearsThe 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 over 12 yearsOk 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.