Install mysql-python (mysqldb)įinally, now we can install mysql-python! We will have to include the right path, to install it correctly. $ cp -R include/* /Applications/MAMP/Library/include/mysql 4. $ mkdir -p /Applications/MAMP/Library/include/mysql $ cp libmysql/*.dylib /Applications/MAMP/Library/lib/ DMYSQL_UNIX_ADDR=/Applications/MAMP/tmp/mysql/mysql.sock -DCMAKE_INSTALL_PREFIX=/Applications/MAMP/Library Now run CMake, build the files, and move them to MAMP. LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES) Replace LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES) The config file has an error! Do the following: $ nano +152 configure.cmake Now if you run CMake with MySQL 5.5.9, you will receive an error message. If you are using another version, take a look here. They are not included by standard MAMP, so we will need to download the source, and make all the header files needed.ĭownload MAMP_components_2.0.2.dmg, and mount it.
MySQL buildīefore we install mysql-python, you will need the header files and dynamic libraries for MySQL. Remember to stop MAMP for running before doing this! $ tar cf /Applications/MAMP/db/mysql_bak.tar /Applications/MAMP/db/mysql 3. If you want to be very safe, make a copy for /Applications/MAMP/Library/mysql so you are sure that the database will not be overwritten.
It is very easy, go to and download the Mac OS X dmg file. We need CMake for compiling MySQL to get the right header files. Make sure that XCode is installed, and also that the command line tools has been installed (XCode > Preferences > Downloads). I assume you already have MAMP installed.
Tested on following setup Mac OS X version: 10.7.5 This will be a bit long, as there is some issues that needs to be dealt with for it to work. Everything will be done in the terminal, except installation of XCode, the command-line tools, CMake and MAMP Components dmg fie. These instructions are written for installation of CMake, PIP, mysql-python (mysqldb), along with XCode command-line tools.
This is instructions how to setup so you can run mysql enabled python apps using MySQL on your MAMP installation.