Python_MySQL笔记
一、下载MySQLdb http://www.lfd.uci.edu/~gohlke/pythonlibs/ (打开网页时小红伞会弹出警告,why?)和Python
二、
1、连接数据库,关闭数据库
1 import MySQLdb
2 #connect
3 con = MySQLdb.connect(host="127.0.0.1", port=3306, user="root", passwd="cctvzg2008", db="forpython")
4 #exit
5 con.close()
先占个位
Press Ctrl+w to close ......