Answer the question
In order to leave comments, you need to log in
How to connect MySQL database from php project to Django project?
New to Django programming. I am rewriting a site from php to Django. Unable to connect MySQL database. I installed everything in Django, I can create empty databases and migrate to the project. When trying to
python manage.py migrate
writes
django.db.utils.OperationalError: (1049, "Unknown database 'name_of_database'")
It is clear why this database is not in mySQL (checked by show databases; in mysql). How to connect it?
I will be immensely grateful.
Answer the question
In order to leave comments, you need to log in
This is described in
https://docs.djangoproject.com/en/2.1/howto/legacy...
Everything worked out. Filled first database dump.
sql -u USER -pPASSWORD < dumpname.sql
Then rewrote it in Django models
python manage.py inspectdb
There were problems with database migration, I solved them by removing the id lines in the models for which I was giving errors
It's some kind of special. software for creating such schemes.
Something remotely similar: Edraw can be viewed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question