Install mysql-python in db_ubuntu

Source: Internet
Author: User

1 download mysql-Python 1.2.3

2. Execute sudo Python setup. py install. If the installation fails, the system prompts that setuptools cannot be found.

3) wget-Q http://peak.telecommunity.com/dist/ez_setup.py

2) sudo Python ez_setup.py

4. Execute 2. Failed. The error message "mysql_config" is not found because libmysqlclient is not installed.

5 1) Add "Deb http://security.ubuntu.com/ubuntu Maverick-security main" in/etc/APT/sources. List (quotes are not required)

2) Run sudo apt-Get install libmysqlclient-Dev.

6. Execute 2 and still fail. The system prompts that python. h cannot be found.

7 1) Add "Deb http://ubuntu.mirror.cambrium.nl/ubuntu/ maverick main" in/etc/APT/sources. List (quotes are not required)

2) Run sudo apt-Get install Python-Dev.

8. The execution continues. 2 is successful!

9. Execute Python-> Import mysqldb and import it successfully. installation is complete.

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.