#导入MySQLdb模块,这个模块需要自己安装,安装文档请见http://blog.itpub.net/29989552/viewspace-1805409/
import MySQLdb
import MySQLdb
#打开数据库连接
conn=MySQLdb.connect(host='172.30.249.57',port=3306,user='root',passwd='Welcome1>')
#使用cursor()方法获取游标