Solve the problem of error loading MySQL DB module encountered during Django project
Python version 3.9 was used when creating the Django project. The MySQL database was successfully introduced in the process of doing the project, but later the python version was reduced to 3.7, so this error was reported when re running the system
Problem causes and solutions:
the package used by Django to connect to MySQL in Python 3 is pymysql, so the first step is to install pymysql:
pip install pymysql
Installation does not mean that it is OK. It also needs to be installed in the project__ init__. Add the following code to the. Py file:
import pymysql
pymysql.install_as_MySQLdb()
Read More:
- django.core.exceptions . improveconfigured: error loading MySQL DB module. Django configuring MySQL database
- How to solve the problem of error reporting in the introduction of Python Django no module name ‘Django. Utils. Six’
- BarTender operation encountered the problem of “OLE DB encountered error 0x80004005”
- django.db.utils.OperationalError: no such table: django_admin_log
- DB2 encountered the problem of sqlcode = 911 lock table when updating record update
- How to solve the problem that the project module turns grey in Maven
- Solve the problem that target code version of Maven project sub module in IntelliJ idea is always rolled back
- Django. Using f () to solve the competition problem
- Module not found error: the solution to the problem of no module named ‘MySQL’
- Django. DB. Utils. Programmingerror: (1146, “table * doesn’t exist”) causes and Solutions
- To solve the problem of loading rjava in installation of xlsx
- Importerror of Django error: no module named**
- Solve the problem that dbvisualizer cannot connect to mysql8
- django.db.utils.IntegrityError: UNIQUE constraint failed: auth_user.username
- django.db.utils .IntegrityError: NOT NULL constraint failed: blog_ blog.author_ ID error resolution
- Error loading pscopg2 module: no module named pscopg2
- Solve the problem of using in tensoft 2. X tf.contrib.slim No module named appears in the package: tensorflow.contrib problem
- Django project running service reported an error NameError: name ‘OS’ is not defined
- How to Solve MacOS Big Sur MySQL workbench flashback problem
- After installing MySQL again under Linux, the solution of ‘MySQL module failed to start’ appears