1

I want to use "import MySQLdb" So I downloaded Windows (Architecture Independent), MSI Installer Python 3.3 Address :http://dev.mysql.com/downloads/connector/python/ After the installation is complete,tell me installation failed

import MySQLdb Traceback (most recent call last): File "", line 1, in ImportError: No module named 'MySQLdb' Please tell me how to do。thx.

PS:I use MySQL Server 5.5 and python33

1 Answer 1

1

Take a look at any example in the documentation and you will find that the module coming with oracle's mysql connector is not named MySQLdb, but simply mysql (or rather mysql.connector):

import mysql.connector

cnx = mysql.connector.connect(user='scott', password='tiger',
                              host='127.0.0.1',
                              database='employees')
cnx.close()

From: http://dev.mysql.com/doc/connector-python/en/connector-python-example-connecting.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.