Python学习—Pycharm连接mysql服务器

安装pymysql

pip3 install pymysql

image

安装Mysql客户端驱动(基于Pycharm工具)

image

点击download,下载mysql驱动

image

等待驱动安装成功后,点击OK即可

image

创建数据库

create database tiantian charset=utf8;
use tiantian;

image

创建连接用户

grant all on tiantian.* to tiantian@'192.168.2.%' identified by 'root';
flush privileges;
commit;

image

测试驱动成功:

image

原文地址:https://www.cnblogs.com/ftl1012/p/10380542.html