[Original]python MySQLdb installation, error problems, and workarounds in Windows environments

Source: Internet
Author: User

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Problem: How to install MySQLdb under Windows

Parsing: Python does not have an integrated environment like PHP, such as wamp that integration software directly to all the things needed to build it all at once, but Python is also good in the Linux environment is particularly simple and convenient, just windows trouble point! But as long as everyone to try not to give up, or can succeed; the most Windows environment I, in order to build the environment for Python I will be a variety of Baidu Google to find a lot of blog posts and other articles, distress!

Note: In fact, it is very simple, but we just started to contact, but also do not understand it, installed the first time, the back will feel more simple than PHP;

Installation steps:

The following are the Windows environments:

For python2.7, we can go here http://www.codegood.com/archives/129 download

For python2.6, you can go to HTTP://WWW.CODEGOOD.COM/ARCHIVES/4 download.

Win32 users only need to download mysql-python-1.2.3.win32-py2.7.exe (1,023.1 KiB)

Win64 users only need to download Mysql-python-1.2.3.win-amd64-py2.7.exe (1.0 MiB)

1. Install database MySQL

: http://www.mysql.com/downloads/

I can put a graphic tool in the Mysql-front.

2. Installing MYSQLDB

Well, by this step, you have two choices.

A. Install the compiled version (one minute)

B. From the official website, build your own installation (...). Half an hour to half a day, depending on your system environment and RP)

2-a Install the compiled version:

Http://www.codegood.com/downloads

Download according to your system, double-click Install, fix

Then import MySQLdb to see if it was successful (see if it's a compiled version, delete the other version, and then reinstall it)

Open a command window, run Python input import mysqldb If there is no prompt without MYSQLDB module that is correct, congratulations on your success!

My, win7,64 bit, version 2.7

Mysql-python-1.2.3.win-amd64-py2.7.exe

2-b Build Your own installation

Words to make ready and their compilation gap is not 11:30 point, especially 64-bit Win7, killed

3. Installing Setuptools

You must install Setuptools before installing MYSQLDB, or a compilation error will occur

Http://pypi.python.org/pypi/setuptools

http://peak.telecommunity.com/dist/ez_setup.py Use this installation (64-bit system must use this)


: http://pypi.python.org/pypi/setuptools If you install MYSQLDB without first installing setuptools, you are likely to be prompted with an error.

The above address can be downloaded directly to EXE, so do it directly.

4. Installing MYSQLDB

Download MySQLdb

http://sourceforge.net/projects/mysql-python/

Experience:

1. Install Python and MySQL there is not much to introduce, very simple

2. Installing Setuptools

3. Download the compiled version Mysql-python-1.2.3.win-amd64-py2.7.exe double-click Install

4. You can test the

5. If something goes wrong, take a look at what you are suggesting

Reference Documentation:

1.http://www.cnblogs.com/hongten/p/hongten_python_mysqldb.html

2.http://blog.sina.com.cn/s/blog_717a78b90102v1j3.html (very good advice)

3.http://blog.csdn.net/wklken/article/details/7253245 (I also see his fix)

Author: Raizhong

[Original]python MySQLdb installation, error problems, and workarounds in Windows environments

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.