Getting Started with Python Tutorial: database operations, connecting to MySQL database

Source: Internet
Author: User

Like-minded colleagues can click on the top of the ↑↑↑↑↑↑

This tutorial is dedicated to programmers quickly mastering Python language programming. This article is based on the last course Python Tutorial: Python tutorial: Connecting to a database, adding and manipulating data and Python basics. To learn the basics of Python, please visit: Python Development Tutorial Series-Link summary, continuous update.

Database additions and deletions to change the operation.

We open navicat. Create a Database manager and create a data table: Student

and add initialization data:

The traditional way to do the increase and deletion check:

The traditional way to connect the database, you can use the following engine to operate. The specific code is as follows:

    1. Mysqlconnector

      1. We first install the Mysqlconnector module. : Https://yunpan.cn/cMCmAXMfzrVrS access Password d1e0

      2. Inquire:

      3. To perform additions and deletions to modify the method:

        No news is the best news. No return value if there is no error, the general success. Specifically, you can go to the database to view data.

    2. MySQLdb

      1. First install the MYSQLDB module: Https://yunpan.cn/cMCQkJhY2N43I access password 37ff

      2. Inquire:


      3. To perform additions and deletions to modify the method:

    3. Torndb

      1. Inquire:

      2. Change and delete:

Pycharm Development Tools Automatic Installation module method:

Write the corresponding module name and hover over the icon that appears:

Click the icon to select the install package:



You can install it.

Getting Started with Python Tutorial: database operations, connecting to MySQL database

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.