模块对象没有属性连接

Bis*_*rai 1 mysql-python

我已经安装了Python 2.7和mysql-python 2.7.我想执行此代码以在Python中测试MySQL:

import MySQLdb
db = MySQLdb.connnect(host = "localhost",
                      user="Bishnu Bhattarai",
                      passwd = "password",
                      db = "student")
cursor =db.cursor()
cursor.execute("select * from basic_info" )
numrows = int(cursor.rowcount)
for x in range(0,numrows):
    row = cursor.fetchall()
    print row[0],"-->",row[1]
Run Code Online (Sandbox Code Playgroud)

但它显示错误:

Traceback (most recent call last):
  File "C:\Users\Bishnu\Desktop\database", line 2, in <module>
    db = MySQLdb.connnect(host = "localhost",
AttributeError: 'module' object has no attribute 'connnect'
Run Code Online (Sandbox Code Playgroud)

问题是什么?

Roc*_*key 5

尝试从connect:) 删除第三个'n'