Forums

MySql Improperly Configured

Hello everyone, Recently I have set up the MySql database to replace the existing one that came from Django. So I changed the databases settings in settings.py :

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.mysql",
        "NAME": "vmailhot$default",
        "USER" : "vmailhot",
        "PASSWORD" : "python123",
        "HOST" : "vmailhot.mysql.pythonanywhere-services.com",
    }
}

And I make the migrations and install mysql client properly. Now my website is not working anymore and the error log is saying that mysql is not properly configured. Here's the Error Log .

Have a great day!

How did you install mysqlclient? Are you using a virtual environment to run your web app?

In my virtual environnement I used 'pip install mysqlclient'. And I think it was already installed because it's saying : Requirement already satisfied: mysqlclient in /usr/local/lib/python3.10/site-packages (2.1.0)

That error message would suggest that you weren't in your virtualenv when you ran it -- when a virtualenv is active, it won't look in /usr/local/lib/python3.10/site-packages. How did you activate the virtualenv before running the command?

Thank you very much! I thought I was in my virtual environnement, but I was not. So I activate the virtualenv with workon myvirtualenv and I re-run the installation for mysqlclient. And now everything is working fine. Thank you for your help.

Have a very nice day!

Glad to hear that!