4

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!

rebatoma
  • 734
  • 1
  • 17
  • 32
maafk
  • 6,176
  • 5
  • 35
  • 58
  • look inside the RPM and see if there's anything you need in there. I'm guessing that's the command line client for mysql, which isn't useful if you don't have shell access to the server. – Marc B Oct 30 '15 at 14:59
  • how about just the server component, and the pdo libraries, their config, with confs, and output from phpinfo() – Drew Oct 30 '15 at 14:59
  • If you are using PHP to connect to the MySQL server, you don't need `MySQL-client...`, that's the CLI `mysql` command. For PHP, you should install `php-mysqlnd` and `php-pdo` (or whatever the packages are named). – gen_Eric Oct 30 '15 at 15:00
  • 1
    @RocketHazmat Thanks! That's just what I needed to know. The application shouldn't be affected by the CLI version. – maafk Oct 30 '15 at 15:14

2 Answers2

1

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.

gen_Eric
  • 223,194
  • 41
  • 299
  • 337
0

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

Jeetendra Pujari
  • 1,286
  • 2
  • 17
  • 31