If you are running a version prior to 5.1.3 then I think it should be table_cache and not table_open_cache - you mention in a comment that you are running 5.1.x but that x could be quite important!
Try changing table_open_cache to table_cache and see if that fixes the issue
Jason
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
Sounds like you're doing something like.....
mysql_connect('localhost'....
The mysql client lib, when it sees 'localhost' doesn't bother making a network conection - it uses the local file (unix) socket. In order to find this socket, it should check the php.ini setting, or use the value in my.cnf, or failing these, compiled in default(s).
Check the mysql is running
ps auxwww | grep mysqld
Check its listening on a network socket:
netstats -nap
The above should also show what file socket it is listening on.
Assuming this is a default installation (i.e. listening on the network port and with no root password) You should be able to connect to the network socket using
mysql -u root -h 127.0.0.1
Then
show variables like '%sock%'
will also show you where the filesystem socket is.
Update your php.ini setting, e.g.
mysql.default_socket = /var/lib/mysql/mysql.sock
and restart your webserver.
Best Answer
Check if mysql process isn't already running.
Also check in my.cnf if you have correct bind-address parameter set. It could be either
0.0.0.0
,127.0.0.1
or your external IP. If it's some other IP, it could cause the problem.