Forums

interface error/ mysql

I'm unable to connect mysql which is hosted online. It is showing internal server error with port 3306 even when I have not specified the port This is the connection line: db = sql.connect(host='sql6.freesqldatabase.com', user='user_nm, passwd="paswd", database='db_nm') 'https://photos.google.com/search/tra/photo/AF1QipMUxRuuT6y9FnVm64YRhWr9wqMsTGTfRuosJoiu' enter image description here

You cannot connect to an external database from a free account.

Ok so when I upgrade to paid account, I can connect it right?

Yes, so long as the MySQL server is configured to allow incoming connections from anywhere on the Internet. (You could also use a more restrictive IP whitelist, but that can be complex because the IP addresses used by code running on PythonAnywhere can change over time; more information here.)