1.安装pycharm python3.6 pip
在windows+R cmd
where pip
pip install mysql-client
如何看自已mysql-client有没有装成功
python
import mysql-client
import MySQLdb
con = MySQLdb.connect(
host='127.0.0.1',
user='root',
passwd='',
port=3308,
db='news',
charset='utf8'
)
cursor = con.cursor()
cursor.execute('SELECT * FROM `news`')
rest = cursor.fetchone()
print(rest)