I am trying to connect to mysql on django app but i am facing this error and cannot find solution online

this is my settings.py configuration and the pacakge i used is mysql-connector-python and the error that i am facing is

Error image

    'default': {  
        'ENGINE': 'django.db.backends.mysql',  
        'NAME': 'my_database',  
        'USER': 'root',  
        'PASSWORD': 'your_password',  
        'HOST': '',  
        'PORT': '',  
        'OPTIONS': {  
            'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"  

Try this in the settings.py file and run a command in terminal

pip install mysqlclient

Good Luck 🤞

Back to Top