wget http://cdn.mysql.com//Downloads/Connector-Python/mysql-connector-python-2.1.3.tar.gz

tar mysql-connector-python-2.1.3.tar.gz 

cd ysql-connector-python-2.1.3  

python setup.py install

[root@localhost mysql-connector-python-2.1.3]# pip list
mysql-connector-python (2.1.3)
MySQL-python (1.2.3)
mysql-utilities (1.5.6)
pip (8.1.2)
queuelib (1.4.2)
setuptools (23.1.0)
>>>import mysql.connector
>>>conn = mysql.connector.connect(user='root', password='', database='test', use_unicode=True)                              
>>>cursor = conn.cursor()
>>>cursor.execute('create table user (id varchar(20) primary key, name varchar(20))')
>>>cursor.execute('insert into user (id, name) values (%s, %s)', ['', 'Michael'])
>>>cursor.rowcount
>>>conn.commit()
>>>cursor.close()

mysql-connector-python的更多相关文章

  1. Snippet: Fetching results after calling stored procedures using MySQL Connector/Python

    https://geert.vanderkelen.org/2014/results-after-procedure-call/ Problem Using MySQL Connector/Pytho ...

  2. Installing MySQL Connector/Python using pip v1.5

    The latest pip versions will fail on you when the packages it needs to install are not hosted on PyP ...

  3. MySQL Connector/Python 接口 (一)

    这里仅介绍 MySQL 官方开发的 Python 接口,参见这里: https://dev.mysql.com/doc/connector-python/en/ Chapter 1 Introduct ...

  4. MySQL Connector/Python 安装、测试

         安装Connector/Python: # wget http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-pyth ...

  5. MySQL Connector/Python 接口 (二)

    连接数据库 本文参见这里,示例如何连接MySQL 数据库. import mysql.connector from mysql.connector import errorcode # 连接数据库需要 ...

  6. MySQL Connector/Python 接口 (三)

    本文参见这里. 使用缓冲的 cursor,下例给从2000年加入公司并且还在公司的员工薪水从明天起加15% from __future__ import print_function from dec ...

  7. python使用mysql的三个模块:mysql.connector、sqlalchemy、MySQLdb

    在python中使用mysql其实很简单,只要先安装对应的模块即可,那么对应的模块都有什么?官方也没指定也没提供,pcat就推荐自己遇到的3个模块:mysql.connector.sqlalchemy ...

  8. MySQL:Download Connector/Python

    MySQL Connector / Python是用于Python平台和开发的标准化数据库驱动程序. 此外,MySQL Connector / Python 8.0支持使用MySQL Server 8 ...

  9. mysql.connector操作mysql的blob值

    This tutorial shows you how to work with MySQL BLOB data in Python, with examples of updating and re ...

  10. How to Access MySQL with Python Version 3.4

    http://askubuntu.com/questions/630728/how-to-access-mysql-with-python-version-3-4 How to Access MySQ ...

随机推荐

  1. error MSB3027: Could not copy "xxx.dll" to "xxx.dll". Exceeded retry count of 10. Failed.

    错误提示内容: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3363,5): error MSB302 ...

  2. HDU 2602 Find a way BFS搜索

    题意:找到总时间最少的KFC 分析:两遍BFS 找KFC比较一下 注:有些地方的KFC可能到达不了,wa了一次 #include <iostream> #include <cstdi ...

  3. VirtualBox Headless启动虚拟机

    习惯了在Windows上来学习和娱乐,所以不能切换到Linux系统. 为了Linux编程,我首先尝试了wubi在Windows上安装双系统,但是发现本来启动很快的Windows8安装了双系统之后,系统 ...

  4. USB HID报告及报告描述符简介

    在USB中,USB HOST是通过各种描述符来识别设备的,有设备描述符,配置描述符,接口描述符,端点描述符,字符串描述符,报告描述符等等.USB报告描述符(Report Descriptor)是HID ...

  5. Makefile学习与进阶之Makefile.am和$$(M)的意思

    (1)makefile 中,出现$$(M) 是什么意思,发现还是看实际的Makefile长知识啊 在makefile中,会经常使用shell命令,也经常见到$var 和 $$var的情况,有什么区别呢 ...

  6. maven 本地setting.xml配置

    <?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://mav ...

  7. 【转载】linux strace

    简介 strace常用来跟踪进程执行时的系统调用和所接收的信号. 在Linux世界,进程不能直接访问硬件设备,当进程需要访问硬件设备(比如读取磁盘文件,接收网络数据等等)时,必须由用户态模式切换至内核 ...

  8. 广州大学华软软件学院——NA视频下载

    准备工具: 360极速浏览器(不要认错图标了): 浏览器视频下载插件: 第一步:安装浏览器插件 1.打开浏览器 2.解压,找到插件文件: 3.把插件拖到浏览器中: 4.添加,然后就完成了插件安装 查看 ...

  9. HW6.28

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  10. HDU-4678 Mine 博弈SG函数

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4678 题意就不说了,太长了... 这个应该算简单博弈吧.先求联通分量,把空白区域边上的数字个数全部求出 ...