1. Install MySQLdb module in python2.7 under Windows
Download the corresponding version according to the number of Python bits:
32nd place: https://pypi.python.org/pypi/MySQL-python/1.2.5
64th place: http://arquivos.victorjabur.com/python/modules/MySQL-python-1.2.3.win-amd64-py2.7.exe
Download the corresponding version and install it directly.
After the installation is complete, enter python and import MySQLdb in turn on cmd and press Enter without reporting an error, indicating that the installation is successful.
However, import MySQLdb in pycharm reports an error!
2. Solve the problem that the MySQLdb module of pycharm cannot be imported
First download a MySQL_python-1.2.5-cp27-none-win_amd64.whl
Here is the download link: https://pan.baidu.com/s/1WH1s1BUI3vvFoeICprN7Sg Password: 3c6w
Copy it to the Scripts directory in the python installation directory, and open cmd in the file location