To connect PythonAnywhere to a MySQL database

Hi there, it is good to see you here.

I am trying to connect PythonAnywhere to a MySQL database. My connection to MySQL database from Bash Console in Dashboard, it works fine!

mysql -u kamus5 -h  -p 'kamus5$comment2'

I am also trying to connect MySQL database using PythonAnywhere using this connection string :

SQLALCHEMY_DATABASE_URI = "mysql+mysqlconnector://{username}:{password}@{hostname}/{databasename}".format( username="kamus5", password="Mm688688", hostname="", databasename="kamus5@comment2",)



Moreover, I switched the following ports: 299 to 3306 without success. It turns out Something went wrong :-( ... In my case, what is the connection string for PA to connect MySQL? Any help for this issue? I followed part 1 "A beginner's guide to building a simple database-backed Flask website on PythonAnywhere"

Thank you very much for your guidance.

Regards, Kamus

databasename should be kamus5$comment2 like in the bash command above not kamus5@comment2 like in the connection string you pasted above.

fjl, this is my first website. With your valuable help, I finally got it. I had this issues for a few days. Without you, probably I can't make it. Thank you so much! Kamus

Glad to hear that you made it work!