MySQL server running, PHP can't connect

Hi,

The local mysql server is running on my Macbook. I can access it
through the console client:

$ mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.45 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>

But when I launch a PHP script that tries to connect to it, I get an
error:

$link = mysql_connect("localhost", "root", "");

Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/var/mysql/mysql.sock' (2)

Any ideas what's going on?
scorpionbilli [ Di, 08 April 2008 20:23 ] [ ID #1940543 ]
PHP » comp.lang.php » MySQL server running, PHP can't connect

Vorheriges Thema: move_uploaded_file on localhost
Nächstes Thema: Help