文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>[Python]操作Mysql

[Python]操作Mysql

时间:2011-03-07  来源:young40

Ubuntu下,直接

sudo apt-get install python-mysqldb

在Python代码中,需要import Mysql类库

from MySQLdb import *



连接并运行SQL语句

cn = Connection('localhost', 'root', '')
cn.select_db(
'yphp')
cur
= cn.cursor()
cur.
execute('SET NAMES UTF8')
cur.
execute('select id,url,content from yphp_spider_url where checked=0 limit 0,1')
rs
= cur.fetchone()
print rs
相关阅读 更多 +
排行榜 更多 +
复星健康app下载官方版

复星健康app下载官方版

生活实用 下载
驾驶区德国专业版下载

驾驶区德国专业版下载

赛车竞速 下载
瓜田里下手游下载

瓜田里下手游下载

策略塔防 下载