Method of installing MYSQLDB in Mamp environment _linux

Source: Internet
Author: User

My computer is not installed XAMPP, but installed Mamp PRO, in fact, both are similar, are php+mysql+apache integrated environment, but Mamp GUI interface is more gorgeous, but also more complex.

All right, let's not say this, talk about the problem. First I use the following command to install MYSQLDB:

Pip install Mysql-python But the error prompted that the Mysql_config file could not be found.

This is a good way to find this file and add it to the path.

Find/applications/mamp-name Mysql_config can get the path:/applications/mamp/library/bin, then add the path to the PATH environment variable. (Xampp is also similar to the method, as long as this is set up will succeed, because it will not have the problem behind)

Vim ~/.profile
####---------------------------
Export path= $PATH:/applications/mamp/library/bin, after the effective implementation of the PIP command, found that the hint can not find mysql.h header file, found that Mamp did not take any header files, good pits.

Online look, there are several articles about how to make up the head file, such as downloading the latest mamp_components, and then recompile with CMake, are too troublesome.

Here's an easier way:

Brew Install Mysql-connector-c
Pip install Mysql-python everything is done.

If your system does not have homebrew installed, then you have to install it quickly.

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.