To connect to a MySQL database, hosted on my machine, an iMAC G5 with OS 10.4, I am using the following code:
$dbc = mysql_connect ('localhost', 'guestuser', '123456')
OR die ('Could not connect to MySQL: '.mysql_error() );
However, I receive an error message: Could not connect to MySQL: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2).
MySQL server is running, and user name/password are valid.