PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > MySQL connector installation/upgrade problems
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
MySQL connector installation/upgrade problems

Réponse
 
LinkBack Outils de la discussion
Vieux 23/10/2007, 07h54   #1
David Zentgraf
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut MySQL connector installation/upgrade problems

Hi,

I'm trying to upgrade a server running CentOS 3 to an up-to-date
MySQL 5 installation + PHP4. I installed the MySQL 5 package, server
and client, via RPMs and they work fine, the client tells me it's
version 5.0.45. I went on to recompile PHP 4.4.7 --with-mysql, but
it's still using MySQL client libraries version 3.23.58. I'm kind of
at a loss where it takes these versions from or how I can get it to
use the newer libraries.

Any hints would be greatly appreciated.

Chrs,
Dav
  Réponse avec citation
Vieux 23/10/2007, 09h22   #2
Colin Guthrie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP-INSTALL] MySQL connector installation/upgrade problems

David Zentgraf wrote:
> Hi,
>
> I'm trying to upgrade a server running CentOS 3 to an up-to-date MySQL 5
> installation + PHP4. I installed the MySQL 5 package, server and client,
> via RPMs and they work fine, the client tells me it's version 5.0.45. I
> went on to recompile PHP 4.4.7 --with-mysql, but it's still using MySQL
> client libraries version 3.23.58. I'm kind of at a loss where it takes
> these versions from or how I can get it to use the newer libraries.
>
> Any hints would be greatly appreciated.


Do rpm -qa --nosignature | grep -i mysql and see what old libraries you
have lying around. Specifically look for the devel libraries/packages.
Remove the 3.x versions via RPM and make sure you've installed the
relevant -devel package from MySQL 5.

You can also use the MySQL 5 -shared-compat package to replace the
shared libraries needed by other apps in Fedora, although you may have
to do an "rpm -e --nodeps" to get rid of the currently installed library
prior to installing -shared-compat due to file conflicts. I always like
to test that this has worked tho (typically testing one of the apps in
the packages rpm moaned about when doing a normal "rpm -e" (sans
--nodeps) or by trying to rpm -e the newly installed -shared-compat just
to make sure it is providing the correct deps at least!

HTH


<gripe>
Be warned tho. If you use custom aggregate UDFs in MySQL 5 it the
current version will segfault on you. I tore my hair out over this.
Upstream MySQL have been pretty crap at responding or releasing
something that I reported months ago. The fact they removed all the
daily snapshots has not ed me them to fix it either.

http://bugs.mysql.com/bug.php?id=30312

I had to stick with 5.0.27 for now.
</gripe>

Col
  Réponse avec citation
Vieux 23/10/2007, 11h55   #3
Martin Marques
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] MySQL connector installation/upgrade problems

David Zentgraf escribió:
> Hi,
>
> I'm trying to upgrade a server running CentOS 3 to an up-to-date MySQL 5
> installation + PHP4. I installed the MySQL 5 package, server and client,
> via RPMs and they work fine, the client tells me it's version 5.0.45. I
> went on to recompile PHP 4.4.7 --with-mysql, but it's still using MySQL
> client libraries version 3.23.58. I'm kind of at a loss where it takes
> these versions from or how I can get it to use the newer libraries.
>
> Any hints would be greatly appreciated.


Wouldn't it be easier to upgrade to CentOS 5?
  Réponse avec citation
Vieux 23/10/2007, 12h08   #4
David Christopher Zentgraf
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] MySQL connector installation/upgrade problems

On 23. Oct 2007, at 19:55, Martin Marques wrote:

> Wouldn't it be easier to upgrade to CentOS 5?


We tried to explain that to our host, but their service *major
expletive*, and other hosts in Tokyo ain't better either. :-(

Chrs,
Dav
  Réponse avec citation
Vieux 23/10/2007, 12h33   #5
Colin Guthrie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: [PHP-INSTALL] MySQL connector installation/upgradeproblems

David Christopher Zentgraf wrote:
> On 23. Oct 2007, at 17:22, Colin Guthrie wrote:
>
>> Do rpm -qa --nosignature | grep -i mysql and see what old libraries you
>> have lying around. Specifically look for the devel libraries/packages.
>> Remove the 3.x versions via RPM and make sure you've installed the
>> relevant -devel package from MySQL 5.
>>
>> You can also use the MySQL 5 -shared-compat package to replace the
>> shared libraries needed by other apps in Fedora, although you may have
>> to do an "rpm -e --nodeps" to get rid of the currently installed library
>> prior to installing -shared-compat due to file conflicts. I always like
>> to test that this has worked tho (typically testing one of the apps in
>> the packages rpm moaned about when doing a normal "rpm -e" (sans
>> --nodeps) or by trying to rpm -e the newly installed -shared-compat just
>> to make sure it is providing the correct deps at least!

>
> I did install the shared-compat package (sorry, forgot to mention),
> which littered libmysqlclient.so.10 to .so.15 around my /usr/lib, and I
> guess that PHP is using .so.10 for some reason instead of .so.15 (or
> simply libmysqlclient.so, which is symlinked to .so.15).
> Are you saying that it's save to remove the old libs or the whole
> shared-compat package and simply install the current libs instead? I was
> thinking about it, but then again, these things are there for
> compatibility, so I hoped there was a way to explicitly tell PHP to use
> the latest version while leaving the others around.


The .so file (without the .10 or .15) is just used for compile time
linking, it's not used at runtime.

No, the shared-compat is the correct one ot use here as some of the core
Centos rpms may need a mysql v3 compatible client library.


If you compile PHP and it finds v3 of mysql that means that you must
have the old development libraries for mysql 3 installed in some
capacity (I believe).

What is the output of:
rpm -qa --nosignature --nodigest | grep -i mysql

This should give some clues.

I would imagine (don't know) that PHP would use the mysql_config program
to work out which mysql is installed and get the relevent cflags and
linking options. For me this is provided by the
MySQL-devel-community-5.0.27 package from MySQL... Is this definitely
installed?

Col
  Réponse avec citation
Vieux 23/10/2007, 12h56   #6
David Christopher Zentgraf
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: [PHP-INSTALL] MySQL connector installation/upgrade problems

On 23. Oct 2007, at 20:33, Colin Guthrie wrote:

> If you compile PHP and it finds v3 of mysql that means that you must
> have the old development libraries for mysql 3 installed in some
> capacity (I believe).
>
> What is the output of:
> rpm -qa --nosignature --nodigest | grep -i mysql
>
> This should give some clues.


$ rpm -qa --nosignature --nodigest | grep -i mysql
MySQL-server-community-5.0.45-0.rhel3
mod_auth_mysql-20030510-2.ent
MySQL-shared-compat-5.0.45-0.rhel3
MySQL-client-community-5.0.45-0.rhel3
mysql-bench-3.23.58-16.RHEL3.1
MySQL-python-0.9.1-6
libdbi-dbd-mysql-0.6.5-5
perl-DBD-MySQL-2.1021-4.EL3
qt-MySQL-3.1.2-17.RHEL3
php-mysql-4.3.2-43.ent
MySQL-devel-community-5.0.45-0.rhel3

Now I'm even more confused, the 5.0.45 devel package *is* there.

> I would imagine (don't know) that PHP would use the mysql_config
> program
> to work out which mysql is installed and get the relevent cflags and
> linking options. For me this is provided by the
> MySQL-devel-community-5.0.27 package from MySQL... Is this definitely
> installed?


$ mysql_config
Usage: /usr/bin/mysql_config [OPTIONS]
Options:
--cflags [-I/usr/include/mysql -g -pipe -march=i386 -
mcpu=i686]
--include [-I/usr/include/mysql]
--libs [-L/usr/lib/mysql -lmysqlclient -lz -lcrypt
-lnsl -lm]
--libs_r [-L/usr/lib/mysql -lmysqlclient_r -lz -
lpthread -lcrypt -lnsl -lm -lpthread]
--socket [/var/lib/mysql/mysql.sock]
--port [3306]
--version [5.0.45]
--libmysqld-libs [-L/usr/lib/mysql -lmysqld -lz -lpthread -
lcrypt -lnsl -lm -lpthread -lrt]

Doing a simple ls -l on both /usr/lib/mysql and /usr/include/mysql
shows me that all libraries in there are from Jul 5th, which is too
old to be my recent MySQL install. So these seem to be the files that
need updating. Which package will do that for me?

Chrs,
Dav
  Réponse avec citation
Vieux 23/10/2007, 13h07   #7
Colin Guthrie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: [PHP-INSTALL] MySQL connector installation/upgradeproblems

David Christopher Zentgraf wrote:
> On 23. Oct 2007, at 20:33, Colin Guthrie wrote:
>
>> If you compile PHP and it finds v3 of mysql that means that you must
>> have the old development libraries for mysql 3 installed in some
>> capacity (I believe).
>>
>> What is the output of:
>> rpm -qa --nosignature --nodigest | grep -i mysql
>>
>> This should give some clues.

>
> $ rpm -qa --nosignature --nodigest | grep -i mysql
> MySQL-server-community-5.0.45-0.rhel3
> mod_auth_mysql-20030510-2.ent
> MySQL-shared-compat-5.0.45-0.rhel3
> MySQL-client-community-5.0.45-0.rhel3
> mysql-bench-3.23.58-16.RHEL3.1
> MySQL-python-0.9.1-6
> libdbi-dbd-mysql-0.6.5-5
> perl-DBD-MySQL-2.1021-4.EL3
> qt-MySQL-3.1.2-17.RHEL3
> php-mysql-4.3.2-43.ent
> MySQL-devel-community-5.0.45-0.rhel3
>
> Now I'm even more confused, the 5.0.45 devel package *is* there.


Yeah that looks pretty OK to me (tho' not overly knowledgeable with
Fedora/Centos packaging)

>> I would imagine (don't know) that PHP would use the mysql_config program
>> to work out which mysql is installed and get the relevent cflags and
>> linking options. For me this is provided by the
>> MySQL-devel-community-5.0.27 package from MySQL... Is this definitely
>> installed?

>
> $ mysql_config
> Usage: /usr/bin/mysql_config [OPTIONS]
> Options:
> --cflags [-I/usr/include/mysql -g -pipe -march=i386
> -mcpu=i686]
> --include [-I/usr/include/mysql]
> --libs [-L/usr/lib/mysql -lmysqlclient -lz -lcrypt
> -lnsl -lm]
> --libs_r [-L/usr/lib/mysql -lmysqlclient_r -lz -lpthread
> -lcrypt -lnsl -lm -lpthread]
> --socket [/var/lib/mysql/mysql.sock]
> --port [3306]
> --version [5.0.45]
> --libmysqld-libs [-L/usr/lib/mysql -lmysqld -lz -lpthread
> -lcrypt -lnsl -lm -lpthread -lrt]
>
> Doing a simple ls -l on both /usr/lib/mysql and /usr/include/mysql shows
> me that all libraries in there are from Jul 5th, which is too old to be
> my recent MySQL install. So these seem to be the files that need
> updating. Which package will do that for me?


No, I reckon Jul 5th could be about right.... when was .45 released? I
had it in my head it was august but Jul doesn't seem too far before that
so entirely possible.

Use rpm -qf <filename> to see which package owns which files.

you can also use rpm -V <pck> to verify that the package has not be
modified on disk.

Does PHP 4 perhaps come with it's own mysql library in the source?
Perhaps you have to pass an argument?

Try using something like: --with-mysql=shared,/usr in the configure to
PHP. That's certainly how I configure PHP5. The args for 4 may be
different tho'.

Col.
  Réponse avec citation
Vieux 23/10/2007, 13h23   #8
David Christopher Zentgraf
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: [PHP-INSTALL] MySQL connector installation/upgrade problems

On 23. Oct 2007, at 21:07, Colin Guthrie wrote:

> No, I reckon Jul 5th could be about right.... when was .45 released? I
> had it in my head it was august but Jul doesn't seem too far before
> that
> so entirely possible.


Ah sorry, I was thinking about source installs. RPMs keep the
original creation date I guess. Not overly used to that.

> Use rpm -qf <filename> to see which package owns which files.


Probing two random files in include/mysql and and lib/mysql show they
belong to MySQL-devel-community-5.0.45-0.rhel3.

> you can also use rpm -V <pck> to verify that the package has not be
> modified on disk.


$ rpm -V MySQL-devel-community-5.0.45-0.rhel3
missing d /usr/share/man/man1/comp_err.1.gz
missing d /usr/share/man/man1/mysql_config.1.gz

I suppose this is, albeit not ideal, tolerable?

> Does PHP 4 perhaps come with it's own mysql library in the source?
> Perhaps you have to pass an argument?


Yes, as of PHP4 the --with-mysql is on by default. I tried specifying
--with-mysql-dir=/usr and also shared,/usr, but to no avail.

Chrs,
Dav
  Réponse avec citation
Vieux 23/10/2007, 14h00   #9
Colin Guthrie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: [PHP-INSTALL] MySQL connector installation/upgradeproblems

David Christopher Zentgraf wrote:
> $ rpm -V MySQL-devel-community-5.0.45-0.rhel3
> missing d /usr/share/man/man1/comp_err.1.gz
> missing d /usr/share/man/man1/mysql_config.1.gz
>
> I suppose this is, albeit not ideal, tolerable?


Yeah this is fine. Your system is probably not setup to install docs and
therefore these files just didn't get installed.

>> Does PHP 4 perhaps come with it's own mysql library in the source?
>> Perhaps you have to pass an argument?

>
> Yes, as of PHP4 the --with-mysql is on by default. I tried specifying
> --with-mysql-dir=/usr and also shared,/usr, but to no avail.


Sorry mate I'm out of ideas... Without tracing through the configure
script to nail it down, I'm kinda stumped.

Col
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h22.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,19316 seconds with 17 queries