Issue Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Users/Mvohra/Sites/projects/webservices/apps/functions.php on line 8 Warning: mysql_connect(): No such file or directory in /Users/Mvohra/Sites/projects/webservices/apps/functions.php on line 8 Could not connect: No such file or directorymymac:admin Diagnosis When trying to connect to mysql database using PHP, it is not able to connect to mysql database. The php mysql_connect function uses the mysql sock file descriptor to connect to the database. At times the location of the sock file is different. You can specific the location of sock file as the input to the mysql_connect function. Solution Find out the sock file location if this is at different location then the default. To see the PHP configuration, you can watch the output of phpinfo. The MySQL Database can be administrated with phpMyAdmin. To connect to the MySQL Server from your own scripts use the following connection parameters: Example: $link = mysql_connect('localhost', 'root', 'root'); // use default sock path. or you can connect using an UNIX Socket located at location: /Applications/MAMP/tmp/mysql/mysql.sock Example: $link = mysql_connect( ':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'root' );