cmd下
mysql -hlocalhost -uroot -p123456
python下先安装MySQLdb
http://nchc.dl.sourceforge.net/project/mysql-python/mysql-python-test/1.2.4b4/MySQL-python-1.2.4b4.win32-py2.7.exe
import MySQLdb
db = MySQLdb.connect("localhost","student","root","123456" )
转载于:https://blog.51cto.com/mattien/1744360