Forums

SSH Connection Refused

Hello, I'm trying to SSH to my account and getting the following error

OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to ssh.eu.pythonanywhere.com port 22.
ssh: connect to host ssh.eu.pythonanywhere.com port 22: Connection refused

when running ssh -v roryjbd@ssh.eu.pythonanywhere.com

Can you please advise.

Thanks, Rory

Your account is not on the EU. Don't use the EU SSH server address.

Ah ok thank you, works now! Now when I'm trying to connect to mysql using

mysql -u roryjbd -p

I get:

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

Any ideas? Seems to also be happening on PA console as well now

Thanks, Rory

You need to provide a hostname as well, see: https://help.pythonanywhere.com/pages/UsingMySQL/

Also, if you want to access from outside of PythonAnywhere, you need to use an SSH tunnel, see: https://help.pythonanywhere.com/pages/AccessingMySQLFromOutsidePythonAnywhere/.