机子是centOS6.5,于是首先查看软件库中有没有扩展:yum search php-mysql

既然有那就开始安装扩展吧:yum install php-mysql
dang,出现了如下错误

Transaction Check Error:
file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/armscii8.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/ascii.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/cp1256.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/cp1257.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/cp850.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/cp852.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/cp866.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/dec8.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/geostd8.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/greek.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/hebrew.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/hp8.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/koi8r.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/koi8u.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/latin1.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/latin2.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/latin5.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/latin7.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/macce.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/macroman.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/charsets/swe7.xml from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/czech/errmsg.sys from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/english/errmsg.sys from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64
file /usr/share/mysql/french/errmsg.sys from install of mysql-libs-5.1.73-8.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.24-1.el6.x86_64

仔细分析,原来是之前安装过MySQL5.7,现在安装的MySQL-libs是5.1版本,所以兼容出现了问题
解决
感谢热心网友,发现可以使用MySQL-shared-compat来解决这个兼容性问题
首先访问 http://rpm.pbone.net/index.php3?stat=3&search=MySQL-shared-compat&srodzaj=3&dist%5B%5D=52

点击图中箭头处

解决
感谢热心网友,发现可以使用MySQL-shared-compat来解决这个兼容性问题
首先访问 http://rpm.pbone.net/index.php3?stat=3&search=MySQL-shared-compat&srodzaj=3&dist%5B%5D=52

点击图中箭头处

 


然后想办法拿到下图中的链接

 下载,

 然后安装

接下来,你就可以正常的安装yum install php-mysql 了,因为已经解决了兼容性的问题了。

 
posted on 2019-01-05 13:22  小人物-烟火  阅读(802)  评论(0编辑  收藏  举报