Something Broken When I Went To 5.1.2...

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Maybe this is something simple, maybe I just don't see it...

I recently did a test upgrade from PHP 4 to 5.1.2 on my Slackware 10.0
Linux box, and most
everything seems to be working great.  I also upgraded my MySQL 4 to
5.0.19 (and it's possible that the problem is in the MySQL upgrade, not
the PHP 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 ( ) 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).  Maybe I've misconfigured
something in my php.ini file (I used the recommended one that came with
the software)?  Maybe I need to change something in the pre-compile

The forum for that software claims that such an upgrade 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,

David P. Donahue

Re: Something Broken When I Went To 5.1.2... wrote:
Quoted text here. Click to load it


Check 'mysql.default_socket' in your php.ini file, and 'socket' in your my.cnf  
file.  They need to match.

Also, what are the mod flags for the socket?  They should be 'srwxrwxrwx'.

Finally - stop MySQL and delete the socket (if it isn't deleted when you stop  
MySQL).  Restart MySQL and see if it's recreated.  This will prove the socket is  
not left over from a previous run, i.e. if MySQL crashed.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: Something Broken When I Went To 5.1.2...

Quoted text here. Click to load it

Ah, there's a slight discrepency.  One of them points to the socket,
the other points to a symlink that points to the socket.  Not sure if
it really makes a difference, but it's better that they both point
directly to the socket.  Fixed.

Quoted text here. Click to load it


/etc/rc.d/rc.mysql stop
find / -name 'mysql.sock'

Man, turned up more files than I would have thought.  Did some house
cleaning on that.  This definitely helped, thanks.  Between you and a
reply on another forum, everything's working fine now.  Thanks a bunch!

David P. Donahue

Site Timeline