Jump to content

Recommended Posts

Hi
I am migrating my mysql database from windows xp to centos 6.
I have the database up and running on the linux.
However I cannot connect to it through firefox as I usually do on windows.
I am pretty sure that my PHP scripts are OK and this is a configuration issue.
Reading the error logs I find that it is trying to connect via /var/lib/mysql/mysql.sock and cannot find it

[Thu Jan 26 08:14:19 2017] [error] [client ::1] PHP Warning:  mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/htdocs/HomeLogIn.php on line 87, referer: http://localhost/HomeLogIn.php

The correct location is of course /var/run/mysqld/mysql.sock

There is obviously a configuration file somewhere that is setting the wrong path info, however I cannot find it.

/etc/my.cnf is correct as is /etc/php.ini to the best of my knowledge
------------------------------------------------
my.cnf
[client]
port=3306
socket                         = /var/run/mysqld/mysql.sock
# SERVER SECTION
[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
socket                         = /var/run/mysqld/mysql.sock
#Path to the database root
datadir="/var/lib/mysql/mysql"
--------------------------------

I checked the /etc/httpd content and that seemed OK too.

Obviously I am missing one somewhere but where, any thoughts please?
I tried restarting Mysql with no effect at all.
In fact shutting down the machine and restarting it makes no difference either.
 

Link to comment
https://forums.phpfreaks.com/topic/303037-cannot-find-my-sock/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.