1

I am new to Django and python! I made a project on Django with the default database which is sqlite3. I want to now transfer the database from sqlite3 to Mariadb.

There is no data which is present in current sqlite3. I just want to know how can I transfer the default database.

I have followed the following documentation:

And added, this to my settings.py :

 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.mysql',
         'NAME': 'Techdevio',
         'USER': 'satharkar',
         'PASSWORD': 'root',
         'HOST': 'localhost',
         'PORT': '',
     }
 }

I am not sure, how things will work with this now. I am looking if someone can help me with this. So what I did is by now :

  1. I deleted the db.sqlite3 from my project folder.
  2. Tried to run python manage.py makemigrations but it is throwing error that mysql client is not installed.

I have followed the documentation and installed everything mentioned their. How will things work after this ? So whenever I will try to submit the form in my django project, database, table will be created and data will be then stored under the mariadb?

I am new to all this, looking for a resolution in this case or any suggestions on how to proceed with this situation.

Thanks

1 Answer 1

2

Django doesn't come with mysqlclient and hence you may need to install it by

pip install mysqlclient
Sign up to request clarification or add additional context in comments.

2 Comments

I am getting so many errors by running that command :( -> dpaste.org/CTH5 I am running this on centos7. I have already installed these packages : sudo yum install python3-devel mysql-devel
I was able to download the mysqlclient now with the help of this link. Thanks a lot JPG.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.