Forums

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I know this is not a new topic but mySQL is not working. When I launch the site or use this command from shell I get an error:

mysql -u amarin -u amarin.mysql.pythonanywhere-services.com -p 'amarin$default' 
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

username, Database host address are what I have in the Database page, and from there I can start a console. The password should be correct. What am i doing wrong?

You've repeated -u instead of having -h for the host:

mysql -u amarin -h amarin.mysql.pythonanywhere-services.com -p 'amarin$default'

shouldn't one of the -u flags be -h?

Yes, I am sorry. I must have been tired. thank you

Glad we could help :-)