Saturday, March 23, 2013

Can't connect to local MySQL server through socket

On Lunarpages I was getting this error while trying to use mysqldump from the shell account:

$ mysqldump -u user -p database > db.sql
Enter password:

mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect

A quick fix I found is to use the --protocol=TCP parameter.

No comments: