maafk
maafk

Reputation: 6886

Does the mysql client package version on webserver affect PHP queries?

I have two RHEL servers, one to host the PHP application, one to host the MySQL server.

Database server has MySQL Enterprise version 5.6.21 installed.

While getting the application server built, I asked that the rpm MySQL-client-advanced-5.6.21-1.el6.x86_64 be installed (to match server), but the hardware people don't like this version since 5.6.27 is available which addressed some vulnerabilities.

The question is the following:

Does the mysql client version on the application server affect the database queries coming from the PHP application?

We're using PDO to connect to and query MySQL.

If we do this, does the application server even need a mysql client library?

Please let me know if I can clarify. Thanks!

Upvotes: 4

Views: 410

Answers (2)

Jeetendra Pujari
Jeetendra Pujari

Reputation: 1344

Quote from the Mysql website

MySQL Native Driver is a replacement for the MySQL Client Library (libmysqlclient). MySQL Native Driver is part of the official PHP sources as of PHP 5.3.0.

https://dev.mysql.com/doc/apis-php/en/apis-php-mysqlnd.html

Upvotes: 0

gen_Eric
gen_Eric

Reputation: 227270

PHP uses its own library/driver to connect to MySQL databases. The MySQL-client-advanced package is just the CLI mysql client. PHP does not use this.

For PHP (and PDO), you should install php-pdo and php-mysqlnd. php-mysqlnd is the "MySQL native driver" and contains some enhancements. It also contains the mysqli class and the pdo-mysql connector.

Note: php-mysqlnd versions are unrelated to the MySQL server version.

Upvotes: 1

Related Questions