Instance 1. Obtain the MYSQL versionInstall mysql in windows for python Development
Download the EXE Installation File in MySQL-python Windows
Copy codeThe Code is as follows: #-*-coding: UTF-8 -*-
# Install mysql db for pythonImport MySQLdb as mdb
instance 1, get the version of MySQL
To install the MySQL module in the Windows environment for Python development, see my other article:
Mysql-python Windows exe installation file download
#-*-Coding:utf-8-*-
#安装MYSQL DB for Python
import mysqldb
This article introduces various code instances and details such as Python operations on MYSQL, execution of SQL statements, obtaining result sets, traversing result sets, obtaining a field, obtaining the table field name, inserting images into the
Use Python to operate MySQL database instancesInstall the mysql module on Windows for Python Development
When using python to connect to mysql, you need to use the installation version. The source code version is prone to error prompts. The 32 and 64
Instance 1, get the version of MySQLInstalling MySQL modules in a Windows environment for Python developmentMysql-python Windows exe installation file download
Copy Code code as follows:
#-*-Coding:utf-8-*-
#安装MYSQL DB for
Example 1, get the MySQL version
Copy Code code as follows:
#-*-Coding:utf-8-*-
#安装MYSQL DB for Python
Import MySQLdb as MDB
con = None
Try
#连接mysql的方法: Connect (' IP ', ' user ', ' password ', ' dbname ')
con =
Installing the MySQL module on the Windows platform for Python development
When using Python to connect to MySQL, you need to use the installation version, the source code version is prone to error prompts. The bottom is packaged in 32 and 64
Common functions of python database operations (create table insert count instance 1, obtain MYSQL version)
The code is as follows:
#-*-Coding: UTF-8 -*-# Install mysql db for pythonImport MySQLdb as mdbCon = NoneTry:# Method for connecting to
This article describes how to use common functions of python database operations: obtain mysql version, create tables, insert data, and slect to obtain data. for example, instance 1. obtain MYSQL version.
The code is as follows:
#-*-Coding: UTF-8
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.