If you are like me you used the default MySQL, Apache and PHP provided with Mac OS X Snow Leopard. When you upgraded to Lion it most likely broke for you.
These are the steps that I followed to get MySQL working on Lion:
- Update php.ini - enable all mysql extensions (because I use Zend, wordpress and other frameworks)
- Make sure MySQL is started and you can connect to it in Sequel Pro
- Go to Database > Server Variables and search for ‘socket’. It will most likely be set to ‘/tmp/mysql.sock’
- Update the socket locations for MySQL in your php.ini to /tmp/mysql.sock
Go to System Preferences > Sharing and restart ‘Web Sharing’ by unticking then ticking the checkbox next to it.
Refresh the local website you were working on it should all be working. Fingers Crossed.