#!/usr/bin/env python
#_*_ coding:utf-8 _*_

import MySQLdb

# 打开门
conn = MySQLdb.connect(host='192.168.1.21',user='yangqw',passwd='1',db='free')

# 伸出手
cur = conn.cursor()

# 对数据进行操作
reCount= cur.execute('select * from student')
data = cur.fetchall()

# 伸回手
cur.close()

# 关上门
conn.close()

print reCount
print data

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2022-01-10
  • 2021-07-25
  • 2022-01-01
  • 2021-08-21
  • 2022-02-21
  • 2022-12-23
相关资源
相似解决方案