Python mysqldb Connection Database

Source: Internet
Author: User
There is no way to under a 2.6, if used 2.4 is too low, and toss, half a day to find Mysql-python-1.2.2.win32-py2.6.exe this installation file, installation complete, execute import mysqldb problems prompt:
File "C:\Python26\lib\site-packages\MySQLdb\__init__.py", line +, in
Importerror:dll load failed: The specified module could not be found.
After countless searches, found that the official statement is also not very correct, the official solution is to ld_library_path load such an environment variable, loading the same does not solve the problem, more means of Linux under the processing,
win above, Find a lot of information, found that is missing 2 DLL files for Libguide40.dll, Libmmd.dll search, download the place many, and then copy to Windows\System32 below now execute and appear
error, this thing is amazing ah, Error prompt:
sys:1: deprecationwarning:the sets module is deprecated
This error, I found a lot of information, looked at many things, and finally found that 2.6 this version has deprecated the use of set s This module, but for compatibility still loaded this module but did a warning, I think very
many ways not to let the warning message out or catch the exception, etc. did not succeed, took the worst way, modify the original file, go to the Python installation directory to find the following file python26\ lib\sets.py comment out 83-85 lines
#import warnings
#warnings. Warn ("The sets module is deprecated", deprecationwarning,sta cklevel=2)
On it, I've merged it into 2 rows.
Until now MYSQLDB installed, without any error output, also understand why the official did not launch 2.6 version of the MYSQLDB.
Python3k This version of the sets module should have been supported, so the official starting from the release, has not introduced a real version, that is, now python3k can not use mysqldb this space to connect to MySQL. And a lot of work
now also do not support 3k seems to achieve the popularity of 3k there are many ways to go, and then this stage want to learn Python people to continue to choose and torture spent.

My GUI hasn't started yet, and it's been a day of my time.
  • 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.