Skip to content

Instantly share code, notes, and snippets.

@KellyLSB
Created December 30, 2013 19:34
Show Gist options
  • Save KellyLSB/8186894 to your computer and use it in GitHub Desktop.
Save KellyLSB/8186894 to your computer and use it in GitHub Desktop.
MySQL Compilation Instructions - Mac
# Installing MySQL From Source On MAc
1. Download the Generic Linux (Architecture Independent) Tar from (http://dev.mysql.com/downloads/mysql/)
2. Uncompress the archive `tar -xvf ~/Downloads/mysql-[BUILD].tar.gz`
3. Create a new build folder `mkdir -p ~/build/mysql`
4. Enter build folder `cd ~/build/mysql`
5. Run Cmake `cmake ~/Downloads/mysql-dir`
6. Allow source downloads `cmake . -DENABLE_DOWNLOADS=1`
7. Run make `make` (Will Error) as of 2013-12-30
8. Patch `~/Downloads/mysql-dir/source/source_downloads/gmock-1.6.0/gtest/include/gtest/internal/gtest-port.h`
- Around line 459 ensure that all variables of `GTEST_USE_OWN_TR1_TUPLE` are set to '1'
9. Run make again in your build dir `make`
10. Run make install `make install`
11. Enter the MySQL Director `cd /usr/local/mysql`
12. Run `script/mysql_install_db`
13. Download (https://gist.github.com/KellyLSB/8186835) to `~/Library/LaunchAgents/mysql.from.source.plist`
14. Symlink `/usr/local/mysql/lib/libmysqlclient.18.dylib` to `/usr/local/lib`
15. Add `/usr/local/mysql/bin` to your $PATH
17. Enter your rails project directory
18. Remove mysql2 gem `gem uninstall mysql2` (Remove All)
16. Set bundler to use the new mysql path: `bundle config build.mysql2 --with-mysql-config=/usr/local/mysql/bin/mysql_config`
17. Bundle install
18. Profit?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment