Forums

How can I access mysql database?

I tried to connect to MySQL database created in pythonanywhere with the Python codes running inside PythonAnywhere,

mysql.connector.connect( host=self.__host, user=self.__user, password=self.__password, database=self.__database)

But I encountered the error, "mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'kewang'@'10.0.0.105' (using password: YES)".

What else do I need to configure to get the access?

Make sure that you are connecting to a database that actually exists - they are shown on your Databases page and make sure that you are using the right password - that is the one that you used when you enabled MySQL.