MySQL Forums
Forum List  »  Perl

Re: DBI connect(...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Posted by: Felix Geerinckx
Date: October 31, 2005 02:46PM

Luca Longo wrote:

> adcycle@vps:~/public_html/cgi-bin$ perl test.pl
> DBI connect('database=adcycle','adcycleuser',...) failed: Can't connect to local MySQL server
> through socket '/var/run/mysqld/mysqld.sock' (2) at test.pl line 13

You should check whether your MySQL is running with this socket:

mysql> show variables like 'socket';

If another socket is returned, try to connect with that one as follows:


my $dbh = DBI->connect("$driver:database=$database;mysql_socket=/another/socket.sock", $user, $pass)

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
Re: DBI connect(...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
October 31, 2005 02:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.