pip install pymysql

And then,

setting.py
import pymysql


pymysql.install_as_MySqldb()


And edit

DATABASE: = {
                'default' :{
           'ENGINE': 'django.db.backends.mysql',
'NAME': 'database name',
'USER': 'username',
'PASSWORD': 'password',
'HOST' : 'localhost',
'PORT' : '3306',
         }
}


You need to create database before run migrate command...


On Sun, 6 Oct 2019, 05:31 Motaz Hejaze, <trapper...@gmail.com> wrote:

> If you have data , export it to csv , then after creating the mysql
> database populate it with data ftom csv file
>
> On Sun, 6 Oct 2019, 1:16 am Aldian Fazrihady, <mob...@aldian.net> wrote:
>
>> Have you created the database on MySQL?
>>
>> On Sun, Oct 6, 2019 at 4:36 AM Gulsher Khan <gulsherkhan0...@gmail.com>
>> wrote:
>>
>>> I trying to change default database(sqllite) which is given by the
>>> Django. I want to use mysql database. I put lots of effort but nothing went
>>> well. I successfully has been install mysql, mysqlclient, mysql-connector
>>> whatever i have read in the documentation.
>>>
>>> I'm using OS: Ubuntu 19.04
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/ea48f010-5ea5-4d58-9033-2e83a3e1de06%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/ea48f010-5ea5-4d58-9033-2e83a3e1de06%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> Regards,
>>
>> Aldian Fazrihady
>> http://aldianfazrihady.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAN7EoAZJXnYbh9-dteFP0HWj1ipnKhgSpwM0s%3DH-2-QEN-upQA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAN7EoAZJXnYbh9-dteFP0HWj1ipnKhgSpwM0s%3DH-2-QEN-upQA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHV4E-frya_dhk98K_NzGh0hqGNqVsxsRCppzNNJnJNKwELeGw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHV4E-frya_dhk98K_NzGh0hqGNqVsxsRCppzNNJnJNKwELeGw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ0m4xj_RVPEkxbEFO6%3DQhW91fjf9a7Sk0%3DmrEX_NMr9xHU%3Dew%40mail.gmail.com.

Reply via email to