问题描述
CentOS的VPS中默认安装过MariaDB,但是笔者还是喜欢用原来的Mysql版本;所以经过一番波折,成功把MariaDB删除并安装上了Mysql。
准备部署LNMP其他的环境,Nginx没啥问题,到安装PHP相关插件的时候出现问题。
> sudo yum install -y php-mysql
...
Transaction check error:
file /usr/share/mysql/charsets/README from install of mariadb-libs-1:5.5.56-2.el7.x86_64 conflicts with file from package MySQL-server-5.5.56-1.el7.x86_64
file /usr/share/mysql/charsets/Index.xml from install of mariadb-libs-1:5.5.56-2.el7.x86_64 conflicts with file from package MySQL-server-5.5.56-1.el7.x86_64
file /usr/share/mysql/charsets/armscii8.xml from install of mariadb-libs-1:5.5.56-2.el7.x86_64 conflicts with file from package MySQL-server-5.5.56-1.el7.x86_64
...
满屏都是提示Mariadb和Mysql的包冲突。
解决方法
删除其中存在且造成冲突的包,上面冲突打印中的MySQL-server-5.5.56-1.el7.x86_64
。
rpm -e MySQL-server-5.5.56-1.el7.x86_64
然后再次安装php-mysql
,顺利完成!
我的博客即将搬运同步至腾讯云+社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=oxczk007wghy