【原创】python mysql C…
来源:互联网 发布:js例子 编辑:程序博客网 时间:2024/06/15 08:46
$ easy_install mysql-connector-python
>>>importmysql.connector as conner
>>> conn = conner.connect(user="root",passwd="kaimen", db="zentao", port=3306, pool_name = "mypool",pool_size = 3,)
>>> cursor = conn.cursor()
>>> cursor.execute("show tables");
>>> cursor.fetchall()
[(u'task',)]
>>> cursor =conn.cursor(cursor_class=conner.cursor.MySQLCursorDict)
>>> cursor.execute("show tables");
>>> cursor.fetchall()
[{u'Tables_in_zentao': u'task'}]
>>> cursor = conn.cursor(dictionary=True)
>>> cursor.execute("show tables");
>>> cursor.fetchall()
[{u'Tables_in_zentao':u'task'}]
MySQL 连接池
0 0
- 【原创】python mysql C…
- 【原创】mysql-python安装 dj…
- 【原创】 linux-python-MySQL…
- 【原创】python mysql-connec…
- 【原创】Mysql in mysql…
- 【原创】python try cat…
- 【原创】python The pac…
- 【原创】 linux-python …
- 【原创】 linux-python …
- 【原创】 linux-python …
- 【原创】 linux-python …
- 【原创】 linux-python …
- 【原创】 linux-python …
- 【原创】 python django…
- 【原创】 linux-python …
- 【原创】 python django…
- 【原创】 python django…
- 【原创】python spider …
- 【原创】python MRJob -…
- 鸟哥的linux私房菜学习笔记《三十七》deamon与服务
- 【原创】mysql InnoDB、MyIsa…
- windows2003安装iis提示“需要service pack 2 cdrom上的一些文件”解决方法
- 【原创】python run jav…
- 【原创】python mysql C…
- myEclipse中的server中的Could not create the view: An unexpected exception was thrown.
- WebStorm修改保护色
- 【原创】python 抽取非中英文
- 【原創】python sqlite3&nbsp…
- 【原創】Linux Shell 查…
- 系统学习深度学习(二十四)--WRN
- 【原創】Linux ubuntu 软件源
- 【原创】sudo: -User-&…