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:
Mysqlconnector
We first install the Mysqlconnector module. : Https://yunpan.cn/cMCmAXMfzrVrS access Password d1e0
Inquire:
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.
MySQLdb
First install the MYSQLDB module: Https://yunpan.cn/cMCQkJhY2N43I access password 37ff
Inquire:
To perform additions and deletions to modify the method:
Torndb
Inquire:
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