To sum up, install MySQLdb on Windows.

Source: Internet
Author: User

When you use python to operate MySQL Databases and install the mysqldb module on the window platform, you have to be confused about the various "weird" problems, and even get angry with mysqldb all day, that's why I abandoned python. This kind of error happened when I first came into contact with python. It was so furious!

PS: in fact, the current MySQL module installation is very simple, and there will not be too many problems, usually after installationMySQL-python-1.2.3.win32-py2.7.exeThis file should be successfully imported into mysqldb! You can download and install it here (mysqldb download ).

Many times, when installing some third-party Python modules on the window platform, many small but troublesome installation errors may be caused by inactive python in China, but few people are concerned about it, of course, there are fewer problems to solve. Finally, we recommend a python module of many third-party Windows platforms: Python third-party Windows module Installation File.

Okay, so much nonsense. Let's get started.

FAQs:
1. importerror: DLL load failed: the specified module cannot be found.
----------------------------------
D: \ Program Files \ python2.6> Python
Python 2.6.1 (r261: 67517, DEC 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on Win32
Type "help", "copyright", "credits" or "License" for more information.
>>> Import mysqldb
Traceback (most recent call last ):
File "<stdin>", line 1, in <module>
File "D: \ Program Files \ python2.6 \ Lib \ Site-packages \ mysqldb \__ init _. py", line 19, in <module>

Import _ MySQL
Importerror: DLL load failed: the specified module cannot be found.
----------------------------------
Solution: Download The libmmd. dll (Attachment) and libguide40.dll (Attachment) DLL files and copy them to the Lib \ Site-packages directory of the python installation directory.
See: http://sourceforge.net/forum/message.php? Ms. g_id = 5613887

2. importerror: DLL load failed: the specified module cannot be found.
----------------------------------
D: \ Program Files \ python2.6> Python
Python 2.6 (R26: 66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on Win32
Type "help", "copyright", "credits" or "License" for more information.
>>> Import mysqldb
D: \ Program Files \ python2.6 \ Lib \ Site-packages \ mysqldb \__ init _. py: 34: deprecationwarning: The sets module is deprecated
From sets import ImmutableSet
----------------------------------
Solution:
1) file "_ init _", replace:
 
From sets import ImmutableSet
Class DBAPISet (ImmutableSet ):
 
With
 
Class DBAPISet (frozenset)
 
2) file "converters. py", remove:
 
From sets import BaseSet, Set
 
3) file "converters. py", change "Set" by "set" (IMPORTANT: only two places ):
 
Line 48: return set ([I for I in s. split (',') if I])
Line 128: set: Set2Str,

In addition, you can get other answers from here (MySQL)

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.