Install the MySQLdb module and the pythonmysqldb module in Python.

Source: Internet
Author: User

Install the MySQLdb module and the pythonmysqldb module in Python.

----------------------【Install MySQLdb module for python in Windows]---------------------

1. Check whether the MySQLdb module is installed. Enter the following command in the doscommand line:

> Python

> Import MySQLdb

If no error is reported, the installation is successful. Otherwise, the following error is reported:

Traceback (most recent call last ):
File "E:/python_test/safety/connect_mysql.py", line 2, in <module>
Import MySQLdbs
ImportError: No module named MySQLdb # MySQLdb Is Not Installed

Ii. Installation;

1. Download MySQLdb: https://sourceforge.net/projects/mysqlpythonwinx64py272/files/latest/download (recommended link)

2. Execute the installation. After installation, MySQLdb will be displayed in the C: \ Python27 \ Lib \ site-packages path folder. Then run import MySQLdb on the doscommand line (no error is reported );

 

The preceding steps are completed !~

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.