MySQL Wordpress Errors - Can't start server : Bind on unix socket Permission denied
I recently upgraded an older, pre x86, iMac to 10.4.
Since iLoveTheCode runs on my own home-brewed blog software (and now it's on a new machine), I didn't notice that it broke some old Wordpress/MySQL sites.
After hours of googling and permissions tweaking, here's what I came up with...
Errors in the terminal and log files:
-Can't connect to local MySQL server through socket '/tmp/mysql.sock'
-STOPPING server from pid file
-Can't start server : Bind on unix socket: Permission denied
Observations:
1) There was no /tmp/mysql.sock, so all the solutions creating a symbolic link were useless.
2) The pid file was no where to look for answers.
3) Permission wasn't exactly denied, since no file actually existed.
Things I tried:
-first I checked to see if mysql was running:
ps aux | grep mysql
-then I attempted to shutdown mysql (which gave me trouble at different stages):
./mysqladmin shutdown
-then I attempted to start mysql (which gave me most of the errors):
./mysqld_safe &
-restarted the server machine.
-I'll skip the details about how I did chmod and chown on nearly every file and directory and created symbolics links everywhere.
The fix:
-renamed the /tmp directory (since it contained files I was afraid to delete it)
-ran ./mysqld_safe &
-connected to: ./mysql -u root -p
-mysql was back up, but Wordpress was still broken.
-changed 'localhost' to '127.0.0.1' in wp-config.php in Wordpress installations.
-Success!
Here's a php script from
http://wordpress.org/support/topic/160033 that helped narrow down the problem:
<?php
$db = @mysql_connect('localhost', 'YourUser', 'YourPassword');
if (!$db) echo "connection failed";
else echo "connection succeeded";
?>
Epilog:
I believe changing the localhost first would have fixed everything. I actually think I caused all of my MySQL problems and that sent me down the wrong path. Symbolic or otherwise :)
Hope this helps someone else.
Resources:
http://wordpress.org/support/topic/160033 - Wordpress Support
Relared:
Wordpress - Change the Excerpt Dots to Article Link with Read More Text