-   Linux - General (
-   -   Buzilla issue: "Can't connect to local MySQL server through socket '/tmp/mysql.sock'" (

vitopn 03-22-2005 03:23 PM

Buzilla issue: "Can't connect to local MySQL server through socket '/tmp/mysql.sock'"
Perl: 5.8.5
mysql : Ver 14.7 Distrib 4.1.10a
Apache: 2.0
Bugzilla: 2.18

When click the login button on the bugzilla front page I get the error:

DBI connect('host=localhost;database=bugs;port=3306','bugs',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (13) at /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi/ line 597
DBI::__ANON__('undef', 'undef') called at /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi/ line 648
DBI::connect('DBI', 'DBI:mysql:host=localhost;database=bugs;port=3306', '', '', 'HASH(0x9e9b38c)') called at Bugzilla/ line 146
Bugzilla::DB::_connect('DBI:mysql:host=localhost;database=bugs;port=3306') called at Bugzilla/ line 138
Bugzilla::DB::connect_main() called at line 143
Bugzilla::dbh('Bugzilla') called at Bugzilla/Auth/ line 154
Bugzilla::Auth::CGI::login('Bugzilla::Auth::CGI', 2) called at line 74
Bugzilla::login('Bugzilla', 2) called at /var/www/html/bugzilla/query.cgi line 61
at Bugzilla/ line 146

I've temporarially removed the bugzilla db user's (bugs) password.

I have tested that mysql is working with the following command:
mysql -u bugs -S/tmp/mysql.sock -P3306

The socket file is there and the permissions seem wide open

[root@Sydney tmp]# ls -l /tmp/mysql.sock
srwxrwxrwx 1 mysql mysql 0 Mar 22 12:01 /tmp/mysql.sock

Any thoughts?

vitopn 03-22-2005 05:13 PM

More Info
Since the original post I asked some friends for help. One mentioned that I should try it with a db password set for bugs (bugzilla's db user), so I set the password to"vtest" both in the "/var/www/html/bugzilla/localconfig" and in mysql.

One also gave me a perl script to test with:

#!/usr/bin/perl -w

use DBI;
use strict;

my $dbh = DBI->connect('DBI:mysql:bugs:localhost',
'bugs', # username
'vtest', # password
if (!$dbh) { die "Cannot connect to database" }
my $query = 'select count(*) from attachments';
my $sth = $dbh->prepare($query);
if (!$sth) { die "Illegal query; $query" };
while (my @row=$sth->fetchrow_array) {
print "$row[0]\n";

The script worked fine.

Other friend had me change my host file from : localhost.localdomain localhost

to localhost localhost.localdomain

to ensure that it was using bugs@localhost to login (instead of bugs@localhost.localdomain).

I should also mention that I installed bugzilla and mysql manually (without the rpms).

I've tried all of this and I am still getting the same error. Any help would be appreciated.

Thank you.

fudy 05-21-2007 02:59 AM

Has this problem cleared?
Recently I met the same question with you.So I wonder if you
has solved it.

Additionally, my OS is right FC3, too. It seems reasonable to
throw our doubt on FC3...

vitopn 05-21-2007 10:13 AM

RE: Has this problem cleared?
Hmm. That post was over 2 years ago .. I can't remember the details of how we resolved it but we did. I believe that in the end we downloaded the rpms and installed using them.

Good luck.

All times are GMT -5. The time now is 03:52 PM.