Reputation: 3580
I'm trying to get away from using Mamp, so have recently installed mysql, edited my vhosts and am attempting to run an instance of wordpress from a url that's not localhost.
I think I'm doing something wrong with mysql, as wordpress can't seem to access my database.
I get this error from wordpress -
[2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in in /Users/myusername/workspaces/wordpress/test/wp-includes/wp-db.php on line 1017
my wordpress config looks like this -
define('DB_NAME', 'test_db');
define('DB_USER', 'test_user');
define('DB_PASSWORD', 'test_password');
define('DB_HOST', 'localhost');
I'm accessing mysql from the terminal and am still finding my way around a recent move from windows, but I'm fairlry certain I've set up the user and db correctly.
A solution would be great, but would also appreciate some tips on how I go about debugging a problem like this.
Upvotes: 0
Views: 932
Reputation: 7220
mkdir /var/mysql
ln -s /tmp/mysql.sock /var/mysql/mysql.sock
Mac is not Unix. So try this.
And for the tip: when you see an error like No such file or directory
, you're missing a file or directory that the script expect to find.
E.g. if my solution is not working find where mysql.sock is and make a link pointing to /var/mysql/mysql.sock
Apparently it's happening for Mac OS X 10.4.4+
Upvotes: 1