0

On CentOS7: I need to upgrade MariaDB from 5.5 to 10.4

I followed this guide: https://itcloudnet.blogspot.com/2019/10/how-to-upgrade-mariadb-55-to-mariadb.html but instructions on other sites are similar.

When I do

yum remove mariadb-server mariadb-devel mariadb-libs mariadb

I get

Removing:
 mariadb
 mariadb-devel
 mariadb-libs
 mariadb-server
Removing for dependencies:
 perl-DBD-MySQL
 php-mysql
 postfix

Then I proceed with the instructions and do

yum install MariaDB-server MariaDB-client

and the output is

Installing:
 MariaDB-client
 MariaDB-server
Installing for dependencies:
 MariaDB-common
 MariaDB-compat
 boost-program-options
 galera-4

So, no php-mysql here. And the biggest mystery of all is that the PHP web applications using MariaDB still work!

How come? So, after all, do I need the package php-mysql or not?

Some clarifications:

  1. I use the standard Apache that comes with CentOS7 httpd-2.4.6.
  2. We have two legacy PHP applications that use the legacy PHP version which comes standard with CentOS7, namely php-5.4.
  3. We have one newer PHP application (Mediawiki) that needs newer PHP. So, I have installed php71 alongside with php-5.4, using Remi repository.
  4. I have switched Apache from mod_php to php-fpm.
  5. I have followed some online instructions how to make both legacy php-fpm-4.5 and the newer php71-php-fpm-7.1 (from Remi) work simultaneously on Apache - to serve both the two legacy and one newer web applications.

But my question still remains: Why my legacy PHP Web applications still work fine without the package php-mysql?

Pavel Tankov
  • 376
  • 3
  • 16

1 Answers1

1

To access MariaDB or MySQL database, you need mysql or mysqli or pdo_mysql extension.

The old php-mysql package have runtime dependency on libmysqlclient (that is removed with mariadb-libs)

The alternative php-mysqlnd use the PHP Native Driver and provides the same set of extension.

P.S.1. the mysql extension is deprecated and removed from PHP 7.

Remi Collet
  • 2,111
  • 1
  • 12
  • 12
  • OK, I have php-pdo-5.4, so probably that is being used. So, apparently php-mysql has never actually been used and was there just because the old MariaDB dragged it in. Also, I have php71-php-mysqlnd which is most likely being used for the new PHP Web applications. Do I also need to install php71-php-pdo as well? – Pavel Tankov Jun 10 '20 at 10:37
  • If you use PDO... of course you neeed php71-php-pdo... (for the extension) and php71-php-mysqlnd (for the driver) – Remi Collet Jun 10 '20 at 11:55
  • I just found that "yum install php71-php-mysql" drags "php71-php-pdo" as a dependency, so the question is irrelevant. Thanks. – Pavel Tankov Jun 10 '20 at 12:11