MySQL Forums
Forum List  »  Install & Repo

Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Posted by: trstn
Date: April 04, 2007 07:47AM

Hi,

I have "the same" problem.

I installed mysql-standard-4.1.22-unknown-linux-gnu-x86_64-glibc23 into /usr/local/mysql on a fresh debian.

I can start the db via /etc/init.d/mysql-server script.

I can access the db via mysql client on console. I have already filled the db with data.

At startup the socket is created as /tmp/mysql.sock (which is default) not to the configured /var/run/mysqld/mysqld.sock.
I have changed all socket entries in /etc/mysql/my.cnf accordingly to /tmp/mysql.sock.

with
#!/usr/bin/perl -w
use strict;
use DBI;
my $init = qq|DBI:mysql:database;localhost|;
my $dbh = DBI->connect( $init, 'root', '<pass>');

I still get:
DBI connect('database;localhost','root',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at d.pl line 8

I tried all suggestion in this thread! None helped.
Why is still this /var/run.. dir in the error? How do I achieve a change wether to the /tmp/ socket or to the wanted var/run one. The directory /var/run/mysqld has not being created, i did it "by hand".

I have changed the whole path to /var/run/mysqld 777 mysql.mysql for test. Did not help.

I copied the data dir to a different location, configured that, didn't help.

I'm quite eager to know what little mistake I have done. Any suggestions? More data needed?

trstn

Options: ReplyQuote


Subject
Written By
Posted
January 08, 2009 02:01PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
April 04, 2007 07:47AM
April 15, 2009 11:56AM
October 21, 2009 06:18PM


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.