windows under python3.8 connection mysql
Just use python database connection, first install ** mysql-connector, ** mysql- connector is MySQL official drive.
We can use pip command to install MySQL-Connector , executed directly in the window of dos command window (provided that a pip already installed, and the computer environment variables to perform the pip position):
python -m pip install mysql-connector
Use the following code to test mysql-connector is installed successfully:
import mysql.connector
Then install pymysql
Execute python pip.exe install pyMysq directly in the window of dos command window
That appears to install successfully installed pyMysql success
Input cmd import pymysql in interactive mode detection, if the installation is unsuccessful reports an error introduced in pycharm pymysql package
click file- "setting-" project- "project interpreter- "
click top right plus - "input pyMysql-" clicks install package
Create a new file input py import pymysql run without being given pycharm ie import was successful
![img](file:///C:\Users\10305\AppData\Roaming\Tencent\Users\1030554333\QQ\WinTemp\RichOle\6DN%JX4S1NX
I(YLEW$W4D.png)