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.