做爰高潮a片〈毛片〉,尤物av天堂一区二区在线观看,一本久久A久久精品VR综合,添女人荫蒂全部过程av

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

python訪問mysql數據庫的實現方法(2則示例)

來源:懂視網 責編:小采 時間:2020-11-27 14:35:04
文檔

python訪問mysql數據庫的實現方法(2則示例)

python訪問mysql數據庫的實現方法(2則示例):本文實例講述了python訪問mysql數據庫的實現方法。分享給大家供大家參考,具體如下: 首先安裝與Python版本匹配的MySQLdb 示例一 import MySQLdb conn=MySQLdb.connect(user='root',passwd='123',db='example') cur=c
推薦度:
導讀python訪問mysql數據庫的實現方法(2則示例):本文實例講述了python訪問mysql數據庫的實現方法。分享給大家供大家參考,具體如下: 首先安裝與Python版本匹配的MySQLdb 示例一 import MySQLdb conn=MySQLdb.connect(user='root',passwd='123',db='example') cur=c

本文實例講述了python訪問mysql數據庫的實現方法。分享給大家供大家參考,具體如下:

首先安裝與Python版本匹配的MySQLdb

示例一

import MySQLdb
conn=MySQLdb.connect(user='root',passwd='123',db='example')
cur=conn.cursor()
cur.execute("select id,lastname,firstname, date_format(dob,'%Y-%m-%d %H-%i-%s'),phone from employee")
##select username,password, date_format(reg_date,'%Y-%m-%d %H-%i-%s') as date from reg_user
for data in cur.fetchall():
 print data
cur.close()
conn.commit()
conn.close()

示例二

import MySQLdb
conn = MySQLdb.connect(host='localhost',user='root',passwd='')
cursor = conn.cursor()
cursor.execute("create database python")
cursor.execute('use python')
cursor.execute("create table test(id int, content varchar(100))")
#插入一條100條數據
for i in range(1,100):
 cursor.execute("insert into test values(%s,%s)",[i,'haha'])
#獲取數據
cursor.execute('select * from test')
results = cursor.fetchall()
for r in results
 print r
conn.close()

希望本文所述對大家Python程序設計有所幫助。

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

python訪問mysql數據庫的實現方法(2則示例)

python訪問mysql數據庫的實現方法(2則示例):本文實例講述了python訪問mysql數據庫的實現方法。分享給大家供大家參考,具體如下: 首先安裝與Python版本匹配的MySQLdb 示例一 import MySQLdb conn=MySQLdb.connect(user='root',passwd='123',db='example') cur=c
推薦度:
標簽: 訪問 數據庫 示例
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 新丰县| 宁强县| 马山县| 满洲里市| 磐石市| 宣城市| 黄冈市| 泽州县| 东明县| 拉孜县| 平安县| 阿拉善右旗| 库尔勒市| 乌兰浩特市| 正定县| 昌平区| 静海县| 陆川县| 松阳县| 龙岩市| 新竹市| 凤翔县| 彭阳县| 洛南县| 贺州市| 渑池县| 庆安县| 宝坻区| 宁乡县| 常山县| 台中县| 苍溪县| 霍山县| 石景山区| 利川市| 且末县| 长沙县| 宕昌县| 民权县| 长子县| 都江堰市|