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

posted @ 2019-02-14 20:26  小a玖拾柒  阅读(1904)  评论(0编辑  收藏  举报