Solve the problem of operation error when pythonanywhere connects to MySQL database
P粉459440991
P粉459440991 2024-03-31 22:43:19
0
1
488

I have finished my django project and I want to test it on PythonAnywhere, everything is fine until the mysql database connection shows an error

I have paid for a subscription.

/home/ An operation error occurred (1044, "Access to database 'almx98' for user 'almx98'@'%' is denied")

I have a lot of records that I don't want to lose.

pythonanywhere venv settings.py:

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'almx98',
    'HOST': 'almx98.mysql.pythonanywhere-services.com',
    'PORT': '3306',
    'USER': 'almx98',
    'PASSWORD': config('DB_PASSWORD'),
}

}

Server connection settings:

P粉459440991
P粉459440991

reply all(1)
P粉938936304

MySQL database names on PythonAnywhere have the format: <username>$<something> Your default database name looks like this: almx98$default But you may already Created additional database names to be used in the web application.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!