[Fixed]-Getting a SQL error when running "python manage.py migrate" using a MySQL database

1πŸ‘

βœ…

As I said in my comment above, I found the page which had instructed me on how to install drivers. It is this one:

https://www.pythonanywhere.com/wiki/UsingMySQL

However, this Wiki page is a little dated now and it instructed me to install the MySQL connector version 2.0.1. The current version is now 2.0.4. The old version had a bug which meant it would not operate with Django 1.8, as stated here:

http://bugs.mysql.com/bug.php?id=76752

By version 2.0.4 this bug appears to have been corrected.

The line in the PythonAnywhere Wiki page referenced above should change to:

pip3.4 install https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-2.0.4.tar.gz

Once I ran this, the migration appears to have worked successfully on my Django installation.

πŸ‘€Terry Rozmus

0πŸ‘

i have try this,and works…

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'database',
        'USER': 'vocabulator',
        'PASSWORD': '<password>',
        'HOST': 'mysql.server', 
    }
}
πŸ‘€Sarmin Ikoni

Leave a comment