I have this problem.
Connection failed: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock (2)
torino:~# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
torino:~# mysqld
100621 8:19:10 InnoDB: Started; log sequence number 0 421736
100621 8:19:10 [Note] mysqld: ready for connections.
Version: '5.0.51a-24+lenny3-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Debian)
syslog
Code:
Jun 21 08:30:34 torino /etc/init.d/mysql[2575]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jun 21 08:30:34 torino /etc/init.d/mysql[2575]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Jun 21 08:30:34 torino /etc/init.d/mysql[2575]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jun 21 08:30:34 torino /etc/init.d/mysql[2575]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Jun 21 08:30:34 torino /etc/init.d/mysql[2575]:
torino:/var/run/mysqld# ls -asl
total 12
4 drwxrwxrwx 2 mysql mysql 4096 Jun 21 08:31 .
4 drwxr-xr-x 12 root root 4096 Jun 21 08:27 ..
4 -rw-rw---- 1 mysql mysql 5 Jun 21 08:31 mysqld.pid
0 srwxrwxrwx 1 mysql mysql 0 Jun 21 08:31 mysqld.sock
torino:/var/run/#
......
4 drwxrwxrwx 2 mysql mysql 4096 Jun 21 08:31 mysqld
..........
how can I solve?