OSX comes in with Apache and PHP installed. MySQL is something that you will have to install. It did take some time for me to install. It was version errors, 32 and 64 bits. I tried to get PHPMyAdmin working and it threw wrong password errors that led me to work with the application’s config file.
To check if the connection was taking place I wrote this small MySQL connection string
$link = mysql_connect(‘localhost:3306’, ‘root’, ”);
if (!$link) {
die(‘Could not connect: ‘ . mysql_error());
} else { echo “We are good”; }
And it very nicely threw me the below error
Trying to connect via unix:///var/mysql/mysql.sock
To remove this error
1. sudo mkdir /var/mysql
2. ln -s /tmp/mysql.sock /var/mysql/mysql.sock
Enjoy…