安装Connector/Python:

# wget http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-1.0.11.zip
# unzip mysql-connector-python-1.0.11.zip
# cd mysql-connector-python-1.0.11
# python setup.py install

     测试Connector/Python是否装上:

>>> from distutils.sysconfig import get_python_lib
>>> print get_python_lib()
/usr/local/lib/python2.7/site-packages

     小实例:

[root@obe11g ~]# python
Python 2.7.3 (default, Jul 18 2013, 20:53:58)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-3.1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mysql.connector
>>> cnx = mysql.connector.connect(user='waterbin',password='123',host='192.168.1.115',database='test')
>>> cur=cnx.cursor()
>>> cur.execute('select * from t')
>>> print cur.fetchall()
[(1,)]
>>> cnx.close()

By DBA_WaterBin

2013-07-25

Good Luck

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、Hive以及MySQL Connector/J安装过程

    MySQL安装 ①官网下载mysql-server(yum安装) wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch. ...

  4. MySQL Connector/Python 接口 (一)

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

  5. MySQL Connector/Python 接口 (二)

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

  6. win7 MySQL Connector/Net 安装卸载问题

    问题1:卸载MySQL Connector Net 6.9.9 卸载程序无法卸载 方法:注册表搜索 MySQL Connector Net 6.9.9 全部删除 ******************* ...

  7. MySQL Connector/Python 接口 (三)

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

  8. mysql案例-sysbench安装测试

    一 地址 githup地址https://github.com/akopytov/sysbench二 版本 sysbench 1.0.15 curl -s https://packagecloud.i ...

  9. Ubuntu & MacOS安装Mysql & connector

    Ubuntu & MacOS安装Mysql & connector 1. 安装MySql sudo apt-get install mysql-server apt-get insta ...

随机推荐

  1. allegro 的光绘层概念

    TOP层: board geometry/outline  manufacturing/photoplot_outline                  etch/top              ...

  2. 转:微博CacheService架构浅析

    文章来自于:http://www.infoq.com/cn/articles/weibo-cacheservice-architecture 微博作为国内最大的社交媒体网站之一,每天承载着亿万用户的服 ...

  3. 给 chorme Developer Tool F12 开发者工具.加入更酷的代码着色

    地址:https://github.com/mauricecruz/chrome-devtools-zerodarkmatrix-theme 默认样式 替换目录为: mac ~/Library/App ...

  4. poj A Round Peg in a Ground Hole

    http://poj.org/problem?id=1584 #include<cstdio> #include<cstring> #include<cmath> ...

  5. Delphi TdxBarmanager

    在 Form 上放一个 BarManager鼠标右键它,可以建立一个 MainToolBar,鼠标右键MainToolBar,建什么随便你选.只不过,最后设置一下 BarManager 的 Image ...

  6. 【日语】secret base

    君(きみ)と夏(なつ)の终(お)わり 将来(しょうらい)の梦(ゆめ)Kimi to natsu no owari shourai no yume大(おお)きな希望(きぼう) 忘(わす)れないOoki ...

  7. android 解析文章,通过JSON格式请求传递 的好文章,这里记录一下

    http://blog.sina.com.cn/s/blog_8d955f8c0100xv7i.html http://blog.163.com/zhangzheming_282/blog/stati ...

  8. HDOJ 2089 不要62(打表)

    Problem Description 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer). 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来 ...

  9. openSource clouds

    学习当前较主流的开源云基础设施管理软件by Ruiy summarize publish; 我擦,有不时候Ruiy干事也就那吊风格,啥事也就那么随口一说,你们太sensitivity,同网络延迟对存储 ...

  10. Flask+Mysql搭建网站之网页设计

    不得不说,本人极度讨厌网页设计,感觉太麻烦了.不过整好啦还蛮有成就感的. 关于网页设计,现在流行的是扁平化设计. http://www.bootcss.com/ http://www.bootcss. ...