
- #HOW DO I INSTALL MYSQL ON MAC HOW TO#
- #HOW DO I INSTALL MYSQL ON MAC INSTALL#
- #HOW DO I INSTALL MYSQL ON MAC 64 BIT#
- #HOW DO I INSTALL MYSQL ON MAC DOWNLOAD#
#HOW DO I INSTALL MYSQL ON MAC INSTALL#

but instead I recommend this github which has what you need (and does not have XCode):
#HOW DO I INSTALL MYSQL ON MAC DOWNLOAD#
You can get it by downloading XCode/Dev Tools from Apple - this is a big download. Install easy_install if you don't have it.

#HOW DO I INSTALL MYSQL ON MAC HOW TO#
How to check if a library is 32bit/64bit built on Mac OS X? Just had this problem (again!) after getting a new Lion box.īest solution I've found (still not 100% optimal, but working): Edit away, or provide your own, better answer. out of build directory and the error should disappear.Īs I wrote at the top, I'd love to see this answer generalised, as there are numerous other specific experiences of this horrible problem out there. not a particularly future-proof URL) and figure out that you need to cd.

This is pretty easy to Google, but to save you the trouble you will end up here (or maybe not. Library/Python/2.5/site-packages/MySQL_python-1.2./_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Python/2.5/site-packages/MySQL_python-1.2./_mysql.pyc, but XXXX/MySQL-python-1.2.3c1 is being added to sys.path One final hiccup though is that if you start Python from the build directory you will get this error: You should then be able to import MySQLdb without any errors. If upon trying to import you receive an error complaining that Library not loaded: libmysqlclient.18.dylib ending with: Reason: image not found you need to create one additional symlink which is: sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib In the same directory, rebuild your package (ignore the warnings that comes with it) sudo python setup.py build Mysql_config.path = "/usr/local/mysql/bin/mysql_config" sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysqlĮdit the setup_posix.py and change the following This is where it looks for during compilation. MySQLdb community seem to have fixed this bug now.Ĭreate a symbolic link under lib to point to a sub-directory called mysql. Originally required editing _mysql.c, but is now NO LONGER NECESSARY. Remove the egg under Users/$USER/.python-eggs Remove everything under your MySQL-python-1.2.2/build/* directory - don't trust the "python setup.py clean" to do it for you Inside the folder, clean the package: sudo python setup.py cleanĬOUPLE OF EXTRA STEPS, (from this comment) I've reproduced it with a couple of edits belowīefore I start, I assume that you have MySQL, Python, and GCC installed on the mac.ĭownload the latest MySQL for Python adapter from SourceForge.Įxtract your downloaded package: tar xzvf MySQL-python-1.2.2.tar.gz This seemed the most popular to me, and provided the working solution. There are numerous step-by-steps on how to build and install the MySQLdb libraries.

#HOW DO I INSTALL MYSQL ON MAC 64 BIT#
remove the 64 bit version if you have installed it (instructions on this fiddly task are available on SO here), then download and install the 32 bit version (package here) Note: Comments in next paragraph applied to Snow Leopard, but not to Lion, which appears to require 64-bit MySQLįirst off, the author (still?) of MySQLdb says here that one of the most pernicious problems is that OS X comes installed with a 32 bit version of Python, but most average joes (myself included) probably jump to install the 64 bit version of MySQL. Would love to see it edited or generalised if you have better experience of the issue. Here is the tale of my rambling experience with this problem. Installing mysqlclient will install mysqlclient, mysql-connector, and llvmdev (at least, it installed these 3 libraries on my machine). The following SO question was a helpful clue: Python 3 ImportError: No module named 'ConfigParser'. You can simply use conda install mysqlclient to install the libraries required to use MySQLdb as it currently exists.
