5 messages in com.mysql.lists.perlCannot access MySQL from Perl after U...
FromSent OnAttachments
Hal Vaughan19 Mar 2003 12:52 
Greg Meckes19 Mar 2003 13:25 
Christian Hammers19 Mar 2003 13:39 
Hal Vaughan19 Mar 2003 14:05 
Jochen Wiedmann19 Mar 2003 23:04 
Subject:Cannot access MySQL from Perl after Upgrading to 4.0 (On Linux)
From:Hal Vaughan (ha@thresholddigital.com)
Date:03/19/2003 12:52:50 PM
List:com.mysql.lists.perl

I'm using Mandrake Linux 8.2 (upgraded the RPMs to 9.0). It originally had MySQL 3.23 and I had no trouble using it from Perl.

Last night I upgraded to MySQL 4.0.x. It wasn't a straight upgrade -- I basically copied the old files to backup directories and installed 4.0.x new.

Now whenever I try to access MySQL from Perl (using the DBI interface), I get this error:

DBI connect('database=lopas','hal',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at test.pl line 11 Can't connect

There is no socket file (mysql.sock) in the /var/lib/mysql directory (this is the MySQL data dir on this system). (I can't find one in the backup directory either, but it is possible I outsmarted myself and somehow deleted it.)

I searched mysql.com and found a few things similar to my situation. One is to check on the socket with this command line:

mysqladmin --protocol=socket --socket=/tmp/mysql.sock version

which I did, and got this error:

mysqladmin: ERROR: unknown variable 'protocol=socket'

So why am I getting this error for something mysql.com is telling me to do (I notice when I do mysqladmin --help, --protocol is no mentioned at all)?

And, most important, how do I get Perl working with MySQL again?

Thanks for any help or suggestions (or even a URL for the M to RTF!)

Hal