php-mysql版本与Mysql服务器冲突

时间:2012-05-25 13:24:31

标签: php mysql

我安装了php 5.3和mysql server 5.5。我需要安装php-mysql,但是遇到了以下冲突。我该如何解决这个问题?

yum install php-mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.versaweb.com
 * elrepo: elrepo.org
 * extras: yum.phx.singlehop.com
 * updates: yum.phx.singlehop.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.3.3-3.el6_2.8 will be installed
--> Processing Dependency: php-common = 5.3.3-3.el6_2.8 for package: php-mysql-5.3.3-3.el6_2.8.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: php-mysql-5.3.3-3.el6_2.8.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: php-mysql-5.3.3-3.el6_2.8.x86_64
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.61-1.el6_2.1 will be installed
---> Package php-common.x86_64 0:5.3.3-3.el6_2.5 will be updated
--> Processing Dependency: php-common = 5.3.3-3.el6_2.5 for package: php-5.3.3-3.el6_2.5.x86_64
--> Processing Dependency: php-common = 5.3.3-3.el6_2.5 for package: php-cli-5.3.3-3.el6_2.5.x86_64
--> Processing Dependency: php-common = 5.3.3-3.el6_2.5 for package: php-pdo-5.3.3-3.el6_2.5.x86_64
---> Package php-common.x86_64 0:5.3.3-3.el6_2.8 will be an update
--> Running transaction check
---> Package php.x86_64 0:5.3.3-3.el6_2.5 will be updated
---> Package php.x86_64 0:5.3.3-3.el6_2.8 will be an update
---> Package php-cli.x86_64 0:5.3.3-3.el6_2.5 will be updated
---> Package php-cli.x86_64 0:5.3.3-3.el6_2.8 will be an update
---> Package php-pdo.x86_64 0:5.3.3-3.el6_2.5 will be updated
---> Package php-pdo.x86_64 0:5.3.3-3.el6_2.8 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================================
 Package                                       Arch                                      Version                                              Repository                                  Size
===============================================================================================================================================================================================
Installing:
 php-mysql                                     x86_64                                    5.3.3-3.el6_2.8                                      updates                                     79 k
Installing for dependencies:
 mysql-libs                                    x86_64                                    5.1.61-1.el6_2.1                                     updates                                    1.2 M
Updating for dependencies:
 php                                           x86_64                                    5.3.3-3.el6_2.8                                      updates                                    1.1 M
 php-cli                                       x86_64                                    5.3.3-3.el6_2.8                                      updates                                    2.2 M
 php-common                                    x86_64                                    5.3.3-3.el6_2.8                                      updates                                    522 k
 php-pdo                                       x86_64                                    5.3.3-3.el6_2.8                                      updates                                     73 k

Transaction Summary
===============================================================================================================================================================================================
Install       2 Package(s)
Upgrade       4 Package(s)

Total size: 5.2 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test


Transaction Check Error:
  file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.61-1.el6_2.1.x86_64 conflicts with file from package MySQL-server-5.5.20-1.linux2.6.x86_64
  file /usr/share/mysql/charsets/README from install of mysql-libs-5.1.61-1.el6_2.1.x86_64 conflicts with file from package MySQL-server-5.5.20-1.linux2.6.x86_64

4 个答案:

答案 0 :(得分:4)

我建议从http://dev.mysql.com/下载shared-compat个软件包,然后用它替换默认的mysql-libsshared-compat提供所有版本的MySQL客户端库,它应满足任何未来的软件升级或安装。例如,使用名为MySQL-shared-compat-5.5.24-1.el6.x86_64.rpm

的包

要安装它,请删除现有的mysql-libs包,同时忽略与rpm -e --nodeps mysql-libs的任何依赖关系,并立即使用rpm -ihv MySQL-shared-compat-5.5.24-1.el6.x86_64.rpm安装新包。

如果服务器正在处理任何生产流量,您当然应该安排维护窗口,因为在安装新库之前删除库可能会导致错误。

稍后您还应考虑将服务器和客户端软件包替换为官方软件包,以避免不同供应商的构建。

答案 1 :(得分:2)

我有类似的问题,例如

Error: mysql conflicts with MySQL-server
Error: mysql-server conflicts with MySQL-server

通过在终端

中使用这四个命令解决了这个问题
yum remove MySQL-devel* -y
yum remove MySQL-devel-community* -y
yum remove MySQL-client* -y
yum remove MySQL-server* -y

答案 2 :(得分:0)

我有类似的问题。升级到PHP 5.4应该可以正常工作

答案 3 :(得分:0)

我不得不从启用了mysql和mysql pdo的源码重新安装php,这种方式总是更简单。