MySQL client version mismatch on CentOS 6, no problem on 5?

Support/Development for PHP
sindarina
Forum User
Forum User
Posts: 8
Joined: Sat Aug 10, 2013 3:02 am
Location: Europe

MySQL client version mismatch on CentOS 6, no problem on 5?

Unread post by sindarina »

We are migrating a Plesk setup from a CentOS 5 server to a new one running CentOS 6. They both have the same set of ART MySQL packages, except that the CentOS 5 server still has 'mysqlclient15' installed, and is i386 instead of x86_64.

--
$ rpm -qa |grep mysql |sort
mysql-5.5.37-22.el6.art.x86_64
mysqlclient16-5.1.59-2.el6.art.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
mysql-libs-5.5.37-22.el6.art.x86_64
mysql-server-5.5.37-22.el6.art.x86_64
php-mysql-5.4.28-34.el6.art.x86_64
--

PHP on CentOS 6, however, loads the old version (5.1.59) of the MySQL modules, instead of the new version (5.5.37), like the CentOS 5 setup does. I haven't been able to find a reason why this would happen, such a configuration difference or somesuch.

Any idea why it loads the old version while the new one is available, when the same package version on the older CentOS doesn't have that problem?
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: MySQL client version mismatch on CentOS 6, no problem on

Unread post by scott »

This intentional, php-mysql is linked against the native mysqlclient from the distro.
sindarina
Forum User
Forum User
Posts: 8
Joined: Sat Aug 10, 2013 3:02 am
Location: Europe

Re: MySQL client version mismatch on CentOS 6, no problem on

Unread post by sindarina »

Why does this not occur on CentOS 5, then, where the native mysqlclient would be even older? It shows the newer version on CentOS 5, not on CentOS 6. What causes the difference in behaviour, when both have the exact same version of the ART packages?
sindarina
Forum User
Forum User
Posts: 8
Joined: Sat Aug 10, 2013 3:02 am
Location: Europe

Re: MySQL client version mismatch on CentOS 6, no problem on

Unread post by sindarina »

And more importantly, how can we fix this? On CentOS 6, we're getting syntax errors on SQL grant statements sent by phpMyAdmin, grants that work just fine on CentOS 5. This seems to be the only difference we can find; the older client version.
prupert
Forum Regular
Forum Regular
Posts: 573
Joined: Tue Aug 01, 2006 2:45 pm
Location: Netherlands

Re: MySQL client version mismatch on CentOS 6, no problem on

Unread post by prupert »

What if you use the MySQL native driver in PHP? (see https://php.net/manual/en/mysqlnd.overview.php)

Code: Select all

yum install php-mysqlnd
Lemonbit Internet Dedicated Server Management
sindarina
Forum User
Forum User
Posts: 8
Joined: Sat Aug 10, 2013 3:02 am
Location: Europe

Re: MySQL client version mismatch on CentOS 6, no problem on

Unread post by sindarina »

The 'php-mysqlnd' package conflicts with 'php-mysql';

--
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mysqlnd.x86_64 0:5.4.28-34.el6.art will be installed
--> Processing Conflict: php-mysql-5.4.28-34.el6.art.x86_64 conflicts php-mysqlnd
--> Processing Conflict: php-mysql-5.4.28-34.el6.art.x86_64 conflicts php-mysqlnd
--> Finished Dependency Resolution
Error: php-mysql conflicts with php-mysqlnd-5.4.28-34.el6.art.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
--

Which is needed by 'psa-php5-configurator'. I'd prefer not to mess around with overrides unless absolutely necessary, because it tends to be a pain every time the packages are upgraded.

And again, why would the CentOS 5 build of the same packages not show this issue? Shouldn't the results be the same on both sides, if this is intentional?
prupert
Forum Regular
Forum Regular
Posts: 573
Joined: Tue Aug 01, 2006 2:45 pm
Location: Netherlands

Re: MySQL client version mismatch on CentOS 6, no problem on

Unread post by prupert »

You don't need to do any special stuff, just replace 'php-mysql' with 'php-mysqlnd'. Both packages provide the 'php-mysql' dependency that is needed by 'psa-php5-configurator'. (If you don't believe me, just run "package-cleanup --problems" afterwards to confirm yourself. ;-))

A oneliner to get things running smoothly:

Code: Select all

rpm -e --nodeps php-mysql && yum install php-mysqlnd -y && service httpd graceful
If you ever want to revert, you can switch the package names using the same one-liner.
Lemonbit Internet Dedicated Server Management
Post Reply