Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql can't connct through socket 1

Status
Not open for further replies.

adicus

ISP
Apr 9, 2001
1
US
I am getting this error while trying to open mysql through php. It has only started to happen here recently.

MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

Any thoughts...?
 
I'm not sure if it's the same problem but here goes:

I just did a fresh install of RH 7.0 with apache, php, and mysql.

I had the same problem.
All I had to do was change the permissions on my MySQL directory (in your case "/var/lib/mysql") so that my apache user (the user/group that apache runs as) has access.

check to make sure it also changes permissions on the mysql.sock file. That's the important one.

I believe apache only needs read (maybe execute) access.

chmod 755 /var/lib/mysql

(that's from memory, but you know the gist of the problem)

Milner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top