Connect Python mysqldb to the database

Source: Internet
Author: User

After installing the installation file, run import mysqldb. the following error occurs:
File "C: \ python26 \ Lib \ Site-packages \ mysqldb \__ init _. py", line 19, in <module>
Importerror: DLL load failed: the specified module cannot be found.
After countless searches, I found that the official statement is not very correct. The official solution is to load the environment variable LD_LIBRARY_PATH, which cannot solve the problem, more methods refer to processing in Linux,
Win has no above, and found countless materials, found that the lack of two DLL files are libguide40.dll, libmmd. DLL search, download a lot of places, and then copy to windows \ system32 now run again
The error message is:
SYS: 1: deprecationwarning: The sets module is deprecated
I have read a lot of materials and found that the 2.6 version does not recommend using the sets module, however, this module is still loaded for compatibility, but a warning is prompted. I thought a lot about it.
Multiple methods to prevent warning information from being exposed or capturing exceptions, and so on. In the worst way, modify the original file and go to the python installation directory to find the following file: python26 \ Lib \ sets. comment out lines 83-85 in Py.
# Import warnings
# Warnings. Warn ("The sets module is deprecated", deprecationwarning, stacklevel = 2)
I can merge them into two rows.
By now, mysqldb has been installed, and no error output has been provided. I also understand why mysqldb of version 2.6 has not been officially released.
The current version of python3k should have supported the sets module. Therefore, the official version has not been released since the launch. That is to say, currently, python3k cannot connect to MySQL using the space of mysqldb. And many workers
It seems that there is still a lot of way to achieve the popularization of the 3 K. At this stage, people who want to learn python will have to constantly choose and torture.

It took one day before my gui started.

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.