Python uses three modules of MySQL: Mysql.connector, SQLAlchemy, MySQLdb

Source: Internet
Author: User
Tags mysql client git clone

The use of MySQL in Python is actually very simple, just install the corresponding module, then the corresponding modules have what? The official also did not specify also did not provide, PCAT recommended oneself encountered 3 modules: Mysql.connector, SQLAlchemy, MySQLdb

------------------

1. Installing Mysql.connector

MySQL Connector/python is implementing the MySQL Client/server protocol completely in Python. No MySQL libraries is needed, and no compilation was necessary to run this Python DB API v2.0 compliant driver.

git clone https://github.com/mysql/mysql-connector-pythoncd mysql-connector-   Install

Official documents:

http://dev.mysql.com/doc/connector-python/en/

2. Installing SQLAlchemy

SQLAlchemy is the Python SQL Toolkit and Object relational Mapper, gives application developers the full power and fle Xibility of SQL.

It provides a full suite of the well known enterprise-level persistence patterns, designed for efficient and high-performing D Atabase access, adapted into a simple and pythonic domain language.

git clone https://github.com/zzzeek/sqlalchemyInstall

Official documents:

http://www.sqlalchemy.org/docs/

3. Installing MYSQLDB

MySQL python client forked from MySQLdb, but support asyncronous query

Original official website Github:https://github.com/dccmx/mysqldb

But recommend the following for this improved

This is the Legacy (1.x) version of MySQLdb. While the it is still being maintained, there'll isn't being a lot of new feature development.

git clone https://github.com/farcepest/mysqldb1Install

This mysqldb is not really recommended, in addition, if you want to install in Windows, it is recommended to install the EXE (otherwise the source installation of various problems):

Http://www.codegood.com/downloads

Inside Mysql-python-1.2.3.win-amd64-py2.7.exe, Mysql-python-1.2.3.win32-py2.7.exe are 64-bit and 32-bit versions respectively

(If you are prompted after installing MYSQLDB: Importerror DLL load failed:%1 is not a valid WIN32 application, install a 64-bit version.)

If the Python directory installed on a different disk is not recognized in the 64-bit system, please refer to this article: http://www.cnblogs.com/pcat/p/6021497.html)

Official document: See the files in the Doc folder on GitHub

Python uses three modules of MySQL: Mysql.connector, SQLAlchemy, MySQLdb

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.