Install the MySQLdb module and the pythonmysqldb module in Python.
----------------------【Install MySQLdb module for python in Windows]---------------------
1. Check whether the MySQLdb module is installed. Enter the following command in the doscommand line:
> Python
> Import MySQLdb
If no error is reported, the installation is successful. Otherwise, the following error is reported:
Traceback (most recent call last ):
File "E:/python_test/safety/connect_mysql.py", line 2, in <module>
Import MySQLdbs
ImportError: No module named MySQLdb # MySQLdb Is Not Installed
Ii. Installation;
1. Download MySQLdb: https://sourceforge.net/projects/mysqlpythonwinx64py272/files/latest/download (recommended link)
2. Execute the installation. After installation, MySQLdb will be displayed in the C: \ Python27 \ Lib \ site-packages path folder. Then run import MySQLdb on the doscommand line (no error is reported );
The preceding steps are completed !~