cmd和python的mysql连接方法

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" )


你可能感兴趣的:(mysql,python,连接)