Re: getting error when i changed database sqllite3 to mysql

2019-10-07 Thread Desh Deepak
You can't use above version of django 2.0 with pymysql.


On Mon, 7 Oct 2019, 03:24 'Dick in Texas' via Django users, <
django-users@googlegroups.com> wrote:

> I have tried to use a new, empty database, but that did not work.  Still
> got the question if I have installed MySQLclient.
>
> Tried the statements from Desh Deepak.  The install and import went well.
> However, when I tried to migrate, I got the message:  module 'pymysql' has
> no attribute 'install_as_MySqldb'.  I put this statement directly below the
> import statement.
>
>
> Below is some of my additional background info that may help.
>
> i am begining a django project and want to use MySQL instead of SQLlite.
> So, I watched a video to learn how to use MySQL with Python.  VBased on
> that, I was able to install MySQL into a C:\MySQL directory successfully.
> I also created a database with userid(root) and password.  Then I wrote a
> Python program that read in a CSV file, created a table in the same
> database and then INSERTed the rows into the table.  Also needed to 'import
> mysql.connector'.  Using SQL Workbench, I was able to verify that all was
> successful.
> Next I tried to access this database from Django without success.  Here's
> what I did.  First I created a virtual environment and then activated it.
> Next, ran 'django-admin startproject  .  This created the
> settings file, but it is set up for SQLlite.  I edited this file to change
> these parameters:
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'gammon',
> 'USER':'root',
> 'PASSWORD':'1ltarty#',
> 'HOST': 'localhost',
> 'PORT': '3306',
> I skip the 'migrate' step.  Next was 'python manage.py runserver. This
> failed.  I got many error message which I saved in a text file.  At the
> beginning of the messages MySQLdb could not be imported as it couldn't be
> found.  Neat the end of the errors, there is a message asking if I had
> insjtalled mysqlclient.
> I have researched these two errors without much success.  I tried to
> install MySQLclient, but always get a message that the requirement was
> already satisfied.  I cannot find any module MySQLdb anywhere on  my PC.  I
> think these two areas are related.  Since I am able to use MySQL with
> vanilla Python successfully, I suspect I have a PATH error perhaps.
> I am now at a loss as to what I might try next.  Does anyone have any
> ideas?  All comments appreciated.
>
> --
> 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/d4b3ffa0-cab7-473e-8615-993b4aac4609%40googlegroups.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/CAJ0m4xhTytpwEKqTiaiVyx%2BQ4%2Bp2g%2ByHBiiidanuCZVU7T1W%3DQ%40mail.gmail.com.


Re: getting error when i changed database sqllite3 to mysql

2019-10-07 Thread Tosin Ayoola
Hello in your settings.py files,  you still have,  sqlite3 as your db
engine instead of MySQL so probably try changing that then see if it's
works

On Oct 5, 2019 22:35, "Gulsher Khan"  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
> 
> .
>

-- 
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/CAHLKn70W2n%3D71rsdMdpsmLobh5Jjkfdu0wObO3vYcXahQN%3D7aw%40mail.gmail.com.


Re: getting error when i changed database sqllite3 to mysql

2019-10-06 Thread 'Dick in Texas' via Django users
I just got by the ' 'install_as_MySqldb' error.  SQL needed to be in upper 
case.  Now, got new error.  
new error:  mysqlclient 1.3.13 or newer is required; you have 0.9.3.  Does 
it ever end?

On Saturday, October 5, 2019 at 4:37:11 PM UTC-5, Gulsher Khan 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/8e617136-2955-4e9a-91aa-52a6f78093ce%40googlegroups.com.


Re: getting error when i changed database sqllite3 to mysql

2019-10-06 Thread 'Dick in Texas' via Django users
I have tried to use a new, empty database, but that did not work.  Still 
got the question if I have installed MySQLclient.

Tried the statements from Desh Deepak.  The install and import went well.  
However, when I tried to migrate, I got the message:  module 'pymysql' has 
no attribute 'install_as_MySqldb'.  I put this statement directly below the 
import statement.


Below is some of my additional background info that may help.

i am begining a django project and want to use MySQL instead of SQLlite.  
So, I watched a video to learn how to use MySQL with Python.  VBased on 
that, I was able to install MySQL into a C:\MySQL directory successfully.  
I also created a database with userid(root) and password.  Then I wrote a 
Python program that read in a CSV file, created a table in the same 
database and then INSERTed the rows into the table.  Also needed to 'import 
mysql.connector'.  Using SQL Workbench, I was able to verify that all was 
successful.  
Next I tried to access this database from Django without success.  Here's 
what I did.  First I created a virtual environment and then activated it.  
Next, ran 'django-admin startproject  .  This created the 
settings file, but it is set up for SQLlite.  I edited this file to change 
these parameters:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'gammon',
'USER':'root',
'PASSWORD':'1ltarty#',
'HOST': 'localhost',
'PORT': '3306',
I skip the 'migrate' step.  Next was 'python manage.py runserver. This 
failed.  I got many error message which I saved in a text file.  At the 
beginning of the messages MySQLdb could not be imported as it couldn't be 
found.  Neat the end of the errors, there is a message asking if I had 
insjtalled mysqlclient.
I have researched these two errors without much success.  I tried to 
install MySQLclient, but always get a message that the requirement was 
already satisfied.  I cannot find any module MySQLdb anywhere on  my PC.  I 
think these two areas are related.  Since I am able to use MySQL with 
vanilla Python successfully, I suspect I have a PATH error perhaps.
I am now at a loss as to what I might try next.  Does anyone have any 
ideas?  All comments appreciated.

-- 
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/d4b3ffa0-cab7-473e-8615-993b4aac4609%40googlegroups.com.


Re: getting error when i changed database sqllite3 to mysql

2019-10-06 Thread Joseph Emeka
I think you need to create the database "django" on you database  back-end.
And try making migrations again.

On Sat, Oct 5, 2019, 22:36 Gulsher Khan  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
> 
> .
>

-- 
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/CA%2B3vCYTX7ouQkiUXEx1xATDNfhLNddr%3D%2BQhqbO%2BzjMuYmEEQPg%40mail.gmail.com.


Re: getting error when i changed database sqllite3 to mysql

2019-10-06 Thread Desh Deepak
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,  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,  wrote:
>
>> Have you created the database on MySQL?
>>
>> On Sun, Oct 6, 2019 at 4:36 AM Gulsher Khan 
>> 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
>>> 
>>> .
>>>
>>
>>
>> --
>> 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
>> 
>> .
>>
> --
> 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
> 
> .
>

-- 
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.


Re: getting error when i changed database sqllite3 to mysql

2019-10-05 Thread Motaz Hejaze
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,  wrote:

> Have you created the database on MySQL?
>
> On Sun, Oct 6, 2019 at 4:36 AM Gulsher Khan 
> 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
>> 
>> .
>>
>
>
> --
> 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
> 
> .
>

-- 
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.


Re: getting error when i changed database sqllite3 to mysql

2019-10-05 Thread Aldian Fazrihady
Have you created the database on MySQL?

On Sun, Oct 6, 2019 at 4:36 AM Gulsher Khan 
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
> 
> .
>


-- 
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.


Re: getting error when i changed database sqllite3 to mysql

2019-10-05 Thread Gil Obradors
HI!

Maybe this tutorial can help you
https://medium.com/@a01207543/django-conecta-tu-proyecto-con-la-base-de-datos-mysql-2d329c73192a

(in Spanish)


Missatge de Gulsher Khan  del dia ds., 5 d’oct.
2019 a les 23:36:

> 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
> 
> .
>

-- 
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/CAK-JoTTn_i5yzUYM0Mp6ayPqXraHy2d732jV4KCu09xKrHZJHQ%40mail.gmail.com.