Image

Imageanivair wrote in Imagelinux

new mqsql issue: can't connect to socket

Now that I've got a webserver running just fine on my home system I figured I'd get it going on my work system. The work system is having exactly the opposite problem from my home system. php is great, but when I try to run a mysql query I get:

Error 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

This is a php file, but my other php files work just fine.

I went into /etc/my.cnf and made some changes so that it now looks like this:

[mysqld]
datadir=/var/lib/mysql
socket=/tmp/mysql.sock

[client]
socket=/tmp/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

I thought that my putting the sockets in /tmp I could avoid any permissions problems (some googling agreed) but that didn't help any. I have read permissions across the board on all involved files. I'm not really sure where to go next. according to a ps command mysql is running and the sock files exist and have many read permissions, os no problems there.

Anyone have a clever solution?

I'm running FC3 here at work.