I am having a big problem trying to connect to mysql. When I run:
/usr/local/mysql/bin/mysql start
I have the following error :
<
This doesn't directly answer your question but a subset of it, namely using PythonAnywhere. I kept stumbling upon this question when looking for a fix so I'm adding it here in the hope that it will help others in my situation.
PythonAnywhere decided to change the database connection hostnames in order to improve efficiency and reliability, as detailed here:
The official host name you should use for connecting to your account's MySQL database instance has changed from mysql.server to yourusername.mysql.pythonanywhere-services.com. This bypasses a part of our infrastructure that has started showing problems in recent weeks, and it should be much more efficient and reliable than the old way.
Hence, you will need to update your hostname to the value highlighted above.