Install mysql python lib for XAMPP
I want to query my XAMPP mysql database with python. However, it seems like that I cannot install MySQL-python without having a "real" mysql database installed on my machine. When I install it with easy install I get the following error output
File "setup.py", line 15, in <m开发者_如何学JAVAodule>
File "/tmp/easy_install-qQJSHH/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
File "/tmp/easy_install-qQJSHH/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
EnvironmentError: mysql_config not found
I get a similar error when I install the lib from source. So my guess is that during the installing process it tries to locate my mysql database. However, I don't want to install mysql, but use the mysql from XAMPP. Does anyone have an idea how do you have to install the lib to use it with mysql XAMPP? Thanks for any help in advance!!
P.S. I'm using OS X.
After extracting the MySQL-python-X.X.X tar ball, edit the file site.cfg. Look for the line:
# mysql_config = /usr/local/bin/mysql_config
uncomment the line and replace with:
mysql_config = /opt/lampp/bin/mysql_config
This is assuming you installed XAMPP in /opt/lampp.
精彩评论