redhat_mysql_socket_problem

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



dbi-users@isc.org

Subject: Re: Abrupt Perl Connection Problem after MySQL Upgrade
From: "Paul Glace" <paul@glace.org>
Date: Tue, 12 Sep 2000 11:27:33 -0400

Original Message -----
From: Ilya Sterin <ideas_pc@usa.com>
To: Paul Glace <paul@glace.org>; <dbi-users@isc.org>
Sent: Tuesday, September 12, 2000 12:11 AM
Subject: RE: Abrupt Perl Connection Problem after MySQL Upgrade


> Please attach the script, or better yet copy and paste so it
> won't be stripped,  then maybe we can help, but without the script it is
> hard to tell.  This error can have many reasons.

Ilya,

You are right, I should have included the entire code...

--------------------------------------------------------
#!/usr/local/bin/perl -w
use DBI;

print "Content-type: text/html\n\n";
print "<html><body>\n<p>Test1</p>\n";

my $dbh = DBI->connect("dbi:mysql:$dbname:localhost", "$username",
"$password",
          { PrintError => 1, RaiseError => 1 })
          or die "connecting: $DBI::errstr\n";

print "<p>Test2</p>\n</body></html>\n";
$dbh->disconnect();
--------------------------------------------------------

Bearing in mind that the following revision executes flawlessly...

--------------------------------------------------------
#!/usr/local/bin/perl -w
use DBI;

print "Content-type: text/html\n\n";
print "<html><body>\n<p>Test1</p>\n";

#my $dbh = DBI->connect("dbi:mysql:$dbname:localhost", "$username",
"$password",
#          { PrintError => 1, RaiseError => 1 })
#          or die "connecting: $DBI::errstr\n";

print "<p>Test2</p>\n</body></html>\n";
#$dbh->disconnect();
--------------------------------------------------------

...there is clearly a problem with connectivity.  The problem began after a
mySQL upgrade on the server.  When I execute the problem code from a command
line using 'perl -l dbitest.pl', it returns the first two print statements
and then gives me a 'Segmentation fault (core dumped)'.  httpd returns an
internal server error without outputing the 'Test1'.  The error log reads
'Premature end of script headers'.

I have tried several variations on the connect statement as suggested by
other developers on this discussion group, each to no avail.  These
include...

$dbh = DBI->connect("DBI:mysql:database=<dbname>;hostname=localhost:".
        "mysql_read_default_file=/etc/my.cnf",$username,$password);

Any help would be greatly appreciated.

===

Subject: Re: Abrupt Perl Connection Problem after MySQL Upgrade
From: Rob McMillin <rlm@pricegrabber.com>
Date: Tue, 12 Sep 2000 09:10:19 -0700

Paul Glace wrote:

> ----- Original Message -----
> From: Ilya Sterin <ideas_pc@usa.com>
> To: Paul Glace <paul@glace.org>; <dbi-users@isc.org>
> Sent: Tuesday, September 12, 2000 12:11 AM
> Subject: RE: Abrupt Perl Connection Problem after MySQL Upgrade
>
> > Please attach the script, or better yet copy and paste so it
> > won't be stripped,  then maybe we can help, but without the script it is
> > hard to tell.  This error can have many reasons.
>
> Ilya,
>
> You are right, I should have included the entire code...

Our sysadmin informs me that there is a bug on the RedHat mysql-server RPM where
the /var/lib/mysql directory has permissions 700 but the socket is placed in
/var/lib/mysql/mysql.sock. Oops.

Check the permissions on your socket directory and try, try again. If this is
indeed the issue, call your sysadmin and have him fix this right away.

===



the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu