安装不带 mariadb-libs 的 PHP-Mysql

安装不带 mariadb-libs 的 PHP-Mysql

我正在尝试在运行 Centos 7.3 的服务器上安装 PHP;我已经安装了 php 5.4,并且还运行着 MySQL Server 5.6.28。当我尝试安装 php-mysql 时,它正在尝试安装 mariadb-libs 以获取依赖项,并停止并显示错误:

# yum install php-mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.nac.net
 * extras: mirror.vcu.edu
 * updates: mirror.netdepot.com
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.4.16-42.el7 will be installed
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: php-mysql-5.4.16-42.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: php-mysql-5.4.16-42.el7.x86_64
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.52-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================================================================================
 Package                                                     Arch                                                  Version                                                          Repository                                           Size
==============================================================================================================================================================================================================================================
Installing:
 php-mysql                                                   x86_64                                                5.4.16-42.el7                                                    base                                                101 k
Installing for dependencies:
 mariadb-libs                                                x86_64                                                1:5.5.52-1.el7                                                   base                                                761 k

Transaction Summary
==============================================================================================================================================================================================================================================
Install  1 Package (+1 Dependent package)

当我继续时:

Transaction check error:
  file /usr/share/mysql/charsets/README from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/Index.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/armscii8.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/ascii.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/cp1250.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/cp1251.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/cp1256.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/cp1257.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/cp850.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/cp852.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/cp866.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/dec8.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/geostd8.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/greek.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/hebrew.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/hp8.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/keybcs2.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/koi8r.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/koi8u.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/latin1.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/latin2.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/latin5.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/latin7.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/macce.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/macroman.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/charsets/swe7.xml from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/czech/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/danish/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/dutch/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/english/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/estonian/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/french/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/german/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/greek/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/hungarian/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/italian/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/japanese/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/korean/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/norwegian/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/polish/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/portuguese/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/romanian/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/russian/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/serbian/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/slovak/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/spanish/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/swedish/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64
  file /usr/share/mysql/ukrainian/errmsg.sys from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package MySQL-server-5.6.28-1.el7.x86_64

Error Summary
-------------

有没有办法安装没有这些库的 PHP...或者我该怎么做才能在不卸载 MySQL 服务器的情况下安装该包,因为它是站点的数据库运行的地方(这是从另一台服务器迁移的)。

更新

我正在运行 MySQL 服务器:

# mysql -u root -h 127.0.0.1 -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.28-log MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

并且没有安装 MariaDB:

# yum list mariadb*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.lga7.us.voxel.net
 * epel: mirror.es.its.nyu.edu
 * extras: mirror.netdepot.com
 * remi-safe: repo1.ash.innoscale.net
 * updates: mirror.netdepot.com
Available Packages
mariadb.x86_64                                                                                                              1:5.5.52-1.el7                                                                                                base
mariadb-bench.x86_64                                                                                                        1:5.5.52-1.el7                                                                                                base
mariadb-devel.i686                                                                                                          1:5.5.52-1.el7                                                                                                base
mariadb-devel.x86_64                                                                                                        1:5.5.52-1.el7                                                                                                base
mariadb-embedded.i686                                                                                                       1:5.5.52-1.el7                                                                                                base
mariadb-embedded.x86_64                                                                                                     1:5.5.52-1.el7                                                                                                base
mariadb-embedded-devel.i686                                                                                                 1:5.5.52-1.el7                                                                                                base
mariadb-embedded-devel.x86_64                                                                                               1:5.5.52-1.el7                                                                                                base
mariadb-libs.i686                                                                                                           1:5.5.52-1.el7                                                                                                base
mariadb-libs.x86_64                                                                                                         1:5.5.52-1.el7                                                                                                base
mariadb-server.x86_64                                                                                                       1:5.5.52-1.el7                                                                                                base
mariadb-test.x86_64                                                                                                         1:5.5.52-1.el7                                                                                                base

答案1

php-mysql使用 mariadb 客户端库 (libmysqlclient)

php-mysqlnd使用 MySQL 原生驱动程序并提供相同的扩展集(mysql、mysqli 和 pdo_mysql),因此不依赖 libmysqlclient。

选择一个图书馆

在 yum 专家模式下,从一个已安装的软件包切换到另一个

# yum shell
> remove php-mysql
> install php-mysqlnd
> run
> quit

相关内容