How to upgrade MySQL without breaking PHP/Apache?

How to upgrade MySQL without breaking PHP/Apache?

Post by Whit Blauve » Wed, 13 Jun 2001 11:01:56



Trying to upgrade from 3.23.27 to 3.23.38 via rpm. The problem is then
Apache/PHP cannot connect to the database (using the mysql routines internal
to PHP), so I'm left having to --force --nodeps a downgrade to keep the
system up. Now, PHP can be compiled to use the current MySQL libraries, but
the last time I had to do that (with an install of MySQL 3.23.37 from binary
tar to a Debian box) a needed MySQL library or two wasn't on the system, and
to get it I had to compile MySQL from the source tar. Okay:

1. Is there a way to just get PHP/Apache to talk to the current MySQL
without recompiling to reference the current MySQL libraries?

2. Does the development rpm actually contain what I'll need to point to if I
_do_ have to recompile everything?

3. Considering that PHP/Apache is one of the most common MySQL front ends,
why isn't this set of problems prominently dealt with in the documentation,
if not avoided through clever programming and/or making sure the PHP team
has early access to any interface changes coming along?

Whit

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

 
 
 

How to upgrade MySQL without breaking PHP/Apache?

Post by Joe Stu » Wed, 13 Jun 2001 11:18:10


You should be able to change your mysql.sock in your my.cnf or php.ini file
and it will work. I'm thinking that it's a sock error you are getting.

--Joe


> Trying to upgrade from 3.23.27 to 3.23.38 via rpm. The problem is then
> Apache/PHP cannot connect to the database (using the mysql routines internal
> to PHP), so I'm left having to --force --nodeps a downgrade to keep the
> system up. Now, PHP can be compiled to use the current MySQL libraries, but
> the last time I had to do that (with an install of MySQL 3.23.37 from binary
> tar to a Debian box) a needed MySQL library or two wasn't on the system, and
> to get it I had to compile MySQL from the source tar. Okay:

> 1. Is there a way to just get PHP/Apache to talk to the current MySQL
> without recompiling to reference the current MySQL libraries?

> 2. Does the development rpm actually contain what I'll need to point to if I
> _do_ have to recompile everything?

> 3. Considering that PHP/Apache is one of the most common MySQL front ends,
> why isn't this set of problems prominently dealt with in the documentation,
> if not avoided through clever programming and/or making sure the PHP team
> has early access to any interface changes coming along?

> Whit

> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)



> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


------------------------------------------------------------------------
"To each his own - My own is GNU/Linux" --Joe Stump

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

 
 
 

How to upgrade MySQL without breaking PHP/Apache?

Post by Whit Blauve » Thu, 14 Jun 2001 06:21:59



> You should be able to change your mysql.sock in your my.cnf or php.ini file
> and it will work. I'm thinking that it's a sock error you are getting.

Joe,

Thanks. By coincidence this appeared in the php.net annotated manual today:

===

12-Jun-2001 02:09

For the "Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (111)" errors:

Set "mysql.default_socket= /var/lib/mysql/mysql.sock" in php.ini and
restart Apache.
===

I'll test later when there's less traffic on the server. Since I didn't have
this set in either my.cnf or php.ini at all, I guess MySQL decided to change
the default location of the file from /tmp.

Whit

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

 
 
 

How to upgrade MySQL without breaking PHP/Apache?

Post by Joe Stu » Thu, 14 Jun 2001 06:38:53


You can also put this in your mysql_connect ... check out the syntax for it
but I believe you can do this:

mysql_connect("server:port:socket","username","password");

--Joe



> > You should be able to change your mysql.sock in your my.cnf or php.ini file
> > and it will work. I'm thinking that it's a sock error you are getting.

> Joe,

> Thanks. By coincidence this appeared in the php.net annotated manual today:

> ===

> 12-Jun-2001 02:09

> For the "Can't connect to local MySQL server through socket
> '/tmp/mysql.sock' (111)" errors:

> Set "mysql.default_socket= /var/lib/mysql/mysql.sock" in php.ini and
> restart Apache.
> ===

> I'll test later when there's less traffic on the server. Since I didn't have
> this set in either my.cnf or php.ini at all, I guess MySQL decided to change
> the default location of the file from /tmp.

> Whit


------------------------------------------------------------------------
"To each his own - My own is GNU/Linux" --Joe Stump

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

 
 
 

How to upgrade MySQL without breaking PHP/Apache?

Post by Whit Blauve » Thu, 14 Jun 2001 09:55:20


Think you're right, but I've hundreds of mysql_connects on the server. The
php.ini trick did it though. Thanks.

Whit


> You can also put this in your mysql_connect ... check out the syntax for it
> but I believe you can do this:

> mysql_connect("server:port:socket","username","password");

> --Joe

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php