pycharm连通mysql的图文教程

Y2J
Release: 2018-05-24 13:44:06
Original
3049 people have browsed it

在进行Python研发的时候,pycharm是一个很好的IDE,下面这篇文章主要给大家介绍了pycharm中连接mysql数据库的步骤,文中通过图文介绍的非常详细,对大家具有一定的参考价值,需要的朋友们下面来一起看看吧。

前言

最近在新的环境配置pycharm的项目时候,发现pycharm不能连接到mysql数据库。由于安了java环境但是还没配置相关的库,并且jetbrains家的IDE一般都是java写的,于是猜想可能是java缺少mysql的驱动。所以就动手起来,总算是成功了,所以将过程分享出来给大家,需要的朋友们一起来学习学习。

一、先确保python能正常连接到数据库

可以如下图测试,如果无报错,说明正常连接到了数据库


如果有报错,可能是缺少MySQLdb包

先去下载MYSQLdb

官方下载:MySQLdb

一步步next就能安装

二、配置好java环境

这一步网上教程很多,也很简单,略过

三、配置pycharm

先下载mysql 的jdbc mysql-connector-java

 

解压后注意这个文件的位置

 

打开pycharm的database插件,新增一个MySQL连接

 

填好各项

 

注意此时你看到的Driver后面可能和我不一样,这代表你需要接着做

 

 

 

 

添加后再看,问题解决

总结

【相关推荐】

1. Python免费视频教程

2. Python面向对象视频教程

3. python基础入门手册

The above is the detailed content of pycharm连通mysql的图文教程. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!