Something Broken When I Went To 5.0.19...
Something Broken When I Went To 5.0.19...
am 28.03.2006 20:01:50 von 47computers
Maybe this is something simple, maybe I just don't see it...
I recently did a test upgrade from MySQL 4 to 5.0.19, and most
everything seems to be working great. I also upgraded my PHP to 5.1.2
(and it's possible that the problem is in the PHP upgrade, not the
MySQL upgrade... but I need a place to start). Most everything seems
to be working fine in my testing, except a PHP-based MySQL-backed forum
software I use (http://www.phpbb.com) on a couple of my hosted sites.
When the code tries to connect to the new database service, it produces
the following error:
-------------------------
Warning: mysql_connect() [function.mysql-connect]: Can't connect to
local MySQL server through socket '/tmp/mysql.sock' (13) in
/mnt/webusers/myerscreek/forum/db/mysql4.php on line 48
Warning: mysql_error(): supplied argument is not a valid MySQL-Link
resource in /mnt/webusers/myerscreek/forum/db/mysql4.php on line 330
Warning: mysql_errno(): supplied argument is not a valid MySQL-Link
resource in /mnt/webusers/myerscreek/forum/db/mysql4.php on line 331
phpBB : Critical Error
Could not connect to the database
-------------------------
I'm guessing the second two warnings are products of whatever went
wrong in the first warning. The file /tmp/mysql.sock is there and is a
symlink to /var/run/mysql/mysql.sock (which is the same .sock that is
symlinked from the MySQL data directory).
The forum for that software claims that an upgrade to MySQL 5 should be
smooth, and when asked about this error they claim not to support it.
Can anyone here possibly shed some light on this for me? Maybe at
least point me in the right direction? I'd really appreciate it,
thanks.
Regards,
David P. Donahue
ddonahue@ccs.neu.edu
http://www.cyber0ne.com
Re: Something Broken When I Went To 5.0.19...
am 28.03.2006 23:32:24 von Bill Karwin
On Tue, 28 Mar 2006 10:01:50 -0800, <47computers@gmail.com> wrote:
> I recently did a test upgrade from MySQL 4 to 5.0.19, and most
> everything seems to be working great. I also upgraded my PHP to 5.1.2
> (and it's possible that the problem is in the PHP upgrade, not the
> MySQL upgrade... but I need a place to start). Most everything seems
> to be working fine in my testing, except a PHP-based MySQL-backed forum
> -------------------------
> Warning: mysql_connect() [function.mysql-connect]: Can't connect to
> local MySQL server through socket '/tmp/mysql.sock' (13)
I assume you've tested that the MySQL daemon is actually running.
IIRC, PHP has linked into it an old MySQL client. If you're trying to
connect to MySQL using 'localhost', it's probably using the socket file
optimization instead of using TCP/IP. So the 4.0 client and the 5.0
server may have their socket files configured to different locations.
You can try to change your phpbb configuration to connect using the
hostname, instead of 'localhost'. That should force it to use TCP/IP
instead of the socket.
There are also problems using PHP to connec to MySQL 4.1+ because the
password encoding used by MySQL changed relative the old client. See
http://dev.mysql.com/doc/refman/5.0/en/old-client.html for more on the PHP
client issues with MySQL.
Regards,
Bill K.
Re: Something Broken When I Went To 5.0.19...
am 29.03.2006 16:05:04 von 47computers
> I assume you've tested that the MySQL daemon is actually
> running.
Roger that. Other applications connect to it just fine.
> IIRC, PHP has linked into it an old MySQL client. If you're
> trying to connect to MySQL using 'localhost', it's probably
> using the socket file optimization instead of using TCP/IP.
> So the 4.0 client and the 5.0 server may have their socket
> files configured to different locations.
Man, I had socket files and symlinks to socket files and symlinks to
symlinks to socket files. Did some housecleaning on that and made sure
php.ini and my.cnf pointed to the same socket file (per advice from
another forum).
> You can try to change your phpbb configuration to connect
> using the hostname, instead of 'localhost'. That should
> force it to use TCP/IP instead of the socket.
Good call on that one, actually. I know nothing of this "socket file
optimization" (though I imagine this is an opportune time to learn),
but I do know that I would prefer TCP/IP since these various services
will eventually be split to multiple machines as load increases over
time.
> There are also problems using PHP to connec to MySQL 4.1+
> because the password encoding used by MySQL changed
> relative the old client. See
> http://dev.mysql.com/doc/refman/5.0/en/old-client.html for more
> on the PHP client issues with MySQL.
Not a problem for me at the moment, but definitely something I should
learn. Thanks.
In any event, between you and a response on another forum, everything's
working like a charm now. Thanks a bunch!
Regards,
David P. Donahue
ddonahue@ccs.neu.edu
http://www.cyber0ne.com
Re: Something Broken When I Went To 5.0.19...
am 29.03.2006 19:55:27 von Bill Karwin
47computers@gmail.com wrote:
> Good call on that one, actually. I know nothing of this "socket file
> optimization" (though I imagine this is an opportune time to learn),
Here's a couple of articles to get you started:
http://en.wikipedia.org/wiki/Interprocess_communication
http://www.amk.ca/python/howto/sockets/
> In any event, between you and a response on another forum, everything's
> working like a charm now. Thanks a bunch!
Terrific! Glad to help.
Regards,
Bill K.