Forums

Can't connect to mysql from console

Today suddenly I cannot access my database from a normal bash console from pythonanywhere. I used the command "mysql -h localhost -u aldosebastian -p --port 3306" and it worked before. I got the error "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)". Can someone help?

The MySQL server you have on PythonAnywhere does not run on localhost -- you should use the hostname from the "Databases" page.