I just installed Lion and for some reasons my internal website stopped working due to the mysql lock file not being found. I found out that the new osx installation changed the mysql sock file default path from /var/mysql/mysql.sock to /tmp/mysql.sock.
So, to re-enable everything, do:
- shut down your Web Sharing
- cp /etc/php.ini.default /etc/php.ini (for some reasons my old php.ini got renamed to
php.ini.defaultphp.ini-5.2-previous…) - modify /etc/php.ini, change ALL /var/mysql/mysql.sock to /tmp/mysql.sock
- enable Web Sharing
That will do it.
Thanks for this! Totally solved my problem. 🙂
LikeLike
Doesn’t work for me although I think it’s correct as I still can connect to MySQL server from command-line and there is “mysql.sock” file in /private/tmp/ directory.
I has changed /priavte/etc/php.ini file but php_info() still shows mysql.default_socket = /var/mysql/mysql.sock. Have no idea why 😦
LikeLike
Hi Ngoc, did you replace all the “/var/mysql/mysql.sock” in your php.ini file? If so, be sure to restart your apache.
LikeLike
Sorry I got it work. My fault! I did not check the php.ini file carefully 😦
LikeLike
Dude! Thanks, your steps worked for me and I feel 100% less frustrated now.
LikeLike
wow – what a life saver …..
Thank You so Much Brian!
LikeLike
Found this after trying to solve it for 6 hours (reinstalled mysql, etc). FML, but thanks!
LikeLike
Thank you so much. That did it. Totally awesome.
LikeLike
thank you. How in the world did u figure this out?
LikeLike
You saved my day! Now I’ll have to figure out how to live without Adobe.
LikeLike
Thanks very much for the timely tip
LikeLike
Thank you very much! 😀
It’s important to change the file name to php.ini for it to be recongized.
Also that I changed at least 4 paths in the php.ini
Very neat explanation.
Thanks again.
LikeLike
I guess it right, you’re one of the best out there in what you do. Cheers
LikeLike
Thanks for this, had just installed a clean version of Lion and was migrating stuff manually from Snow Leopard. This was what I was missing 🙂
LikeLike
Thank you, quick easy fix. Seems like someone at apple could figure this out, when I installed mysql the first time it was a nightmare.
LikeLike
Thx, at last this solved my probs.
LikeLike
Thanks!! really helpful
LikeLike
Nice one for this!
LikeLike
Thanks dude! Don’t know why these guys cannot keep things consistent ><!
LikeLike