首页 > 数据库技术 > 详细

MySQL Connector/Python

时间:2016-01-26 18:11:35      阅读:210      评论:0      收藏:0      [点我收藏+]

MySQL Connector/Python

  MySQL Connector/Python, a self-contained Python driver for communicating with MySQL servers。

  MySQL Connector/Python enables Python programs to access MySQL databases。 It is written in pure Python and does not have any dependencies except for the Python Standard Library.

  MySQL Connector/Python includes support for:

  • Almost all features provided by MySQL Server up to and including MySQL Server version 5.7.

  • Converting parameter values back and forth between Python and MySQL data types, for example Python datetimeand MySQL DATETIME. You can turn automatic conversion on for convenience, or off for optimal performance.

  • All MySQL extensions to standard SQL syntax.

  • Protocol compression, which enables compressing the data stream between the client and server.

  • Connections using TCP/IP sockets and on Unix using Unix sockets.

  • Secure TCP/IP connections using SSL.

  • Self-contained driver. Connector/Python does not require the MySQL client library or any Python modules outside the standard library.

  

 Connector/Python implements the MySQL client/server protocol two ways:

  • As pure Python. This implementation of the protocol does not require any other MySQL client libraries or other components.

  • As a C Extension that interfaces with the MySQL C client library. This implementation of the protocol is dependent on the client library, but can use the library provided by either MySQL Connector/C or MySQL Server packages (see MySQL C API Implementations). The C Extension is available as of Connector/Python 2.1.1.

Code Demo

  技术分享

  The connect() constructor creates a connection to the MySQL server and returns a MySQLConnection object.

参考:http://dev.mysql.com/doc/connector-python/en/connector-python-example-connecting.html

 

MySQL Connector/Python

原文:http://www.cnblogs.com/tekkaman/p/5160930.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!