Hi, I’m trying to access my SQL database hosted on Pythonanywhere eu and I get the following error - sqlalchemy.exc.ProgrammingError: (mysql.connector.errors.ProgrammingError) 1045.(28000): Access denied for user '19roberl'@'10.0.0.42' (using password: YES) (Background on this error at: https://sqlalche.me/e/20/f405)
I am using this code :::python
from flask import Flask, request
from flask_sqlalchemy import SQLAlchemy
import hashlib
app = Flask(__name__)
SQLALCHEMY_DATABASE_URI = (
"mysql+mysqlconnector://{username}:{password}@{hostname}/{databasename}".format(
username="19roberl",
password="12345",
hostname="19roberl.mysql.eu.pythonanywhere-services.com",
databasename="19roberl$account",
)
)
app.config["SQLALCHEMY_DATABASE_URI"] = SQLALCHEMY_DATABASE_URI
app.config["SQLALCHEMY_POOL_RECYCLE"] = 299
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db = SQLAlchemy(app)
app.app_context().push()
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
password = db.Column(db.String(256), nullable=False)
db.create_all()
I have set my database password to be 12345 and the names are correct. Any help would be greatly appreciated