Small PHP/MySQL problem...
Hi guys,
This might not be the place to ask but I KNOW someone here can help me.
When I try to connect to my freshly installed MySQL server through php, I get
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Users/laurens/Sites/PhpProject1/index.php on line 10
And I think this is because MySQL Administrator GUI tool says the socket is at /tmp/mysql.sock
Now... what do I change and where do I change it? I'm a noob at this stuff...
Many thanks in advance!
This might not be the place to ask but I KNOW someone here can help me.
When I try to connect to my freshly installed MySQL server through php, I get
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Users/laurens/Sites/PhpProject1/index.php on line 10
And I think this is because MySQL Administrator GUI tool says the socket is at /tmp/mysql.sock
Now... what do I change and where do I change it? I'm a noob at this stuff...
Many thanks in advance!
Comments
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
You could also change the path in the SQL server GUI but sometimes this breaks other software, which expects the sock file to be in /tmp. The link covers both cases.
Your package should have lock files in the /var/ pathway, by default. You should not have to ln -s to /var/. The package maintainer should manage this in their postinstall scripts.