Pycharm connecting MySQL in a graphic tutorial

Source: Internet
Author: User
In the development of Python, Pycharm is a very good IDE, the following this article is mainly to introduce you to the Pycharm connection MySQL database steps, the text through the graphic introduction of very detailed, for everyone has a certain reference value, the need for friends below to see it together.

Objective

When I recently configured the Pycharm project in the new environment, I found that pycharm could not connect to the MySQL database. Because of the Java environment but have not configured the relevant library, and JetBrains home IDE is generally written in Java, so guess is Java is missing the driver of MySQL. So the hands up, finally is successful, so the process to share out to everyone, the need for friends to learn together.

First, make sure Python can connect to the database properly

Can be such as testing, if no error, indicating that the normal connection to the database


If there is an error, the MYSQLDB package may be missing

Download MySQLdb first.

Official Download: MySQLdb

You can install it in one step next.

Second, configure the Java environment.

This step is a lot of online tutorials, also very simple, skip over

Third, configuration Pycharm

Download the MySQL JDBC Mysql-connector-java first

Note the location of this file after decompression

Open the database plugin for pycharm and add a MySQL connection

Fill in the blanks.

Note that the driver you see at this point may not be the same as me, which means you need to do it.

Add and then look, problem solved

Summarize

"Recommended"

1. Python Free video tutorial

2. Python Object-oriented video tutorial

3. Python Basic Primer manual

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.