MySQL driver Installation:
We use Django to operate MySQL, which actually operates from the bottom of Python. So we want to use Django to operate MySQL, but first we need to install a driver. In Python3, there are a number of options for the driver. such as Pymysql and Mysqlclient. Here we use Mysqlclient to operate. Mysqlclient installation is very simple. Only need to enter the VIRTUALENV virtual environment ' Workon [virtualenv Virtual Environment] ', and then ' pip install Mysqlclient ', you can install.
Introduction to Common MySQL drivers:
1:mysql-python: That is mysqldb. is a simple package for the C-language operation of the MySQL database. Followed the Python DB API v2. But only support Python2, not currently supported Python3
2:mysqlclient: is another branch of Mysql-python. Supports Python3 and fixes some bugs.
3:pymysql: A driver of pure Python implementation. Because it is written in pure python, execution is less efficient than Mysql-python. And because it's written in pure Python, it's seamlessly linked to Python code.
4:mysql Connector/python:mysql is officially launched using pure Python to connect to MySQL driver. Because it's a pure Python development, it's not efficient.
Django eighth Lesson 2. "MySQL Related software"