-
-
Save takus/4198444 to your computer and use it in GitHub Desktop.
Installing MySQL5.1 & Q4M on MacOSX Lion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
MYSQL_VERSION=5.1.65 | |
if [ `which perl` = "/usr/bin/perl" ]; then | |
echo -n -e "\e[1;31mUSING SYSTEM PERL OK? [y/n]\e[m: " | |
read ANSWER | |
if [ "$ANSWER" != "y" ]; then | |
exit 255 | |
fi | |
PERL_CPANM_OPT="$PERL_CPANM_OPT --sudo" | |
fi | |
### MySQL | |
echo -e "\e[1;32mStarting MySQL5.1 installation.\e[m" | |
brew install https://raw.github.com/Homebrew/homebrew-versions/master/mysql51.rb --with-utf8-default --use-llvm | |
mysql_install_db --basedir=/usr/local/Cellar/mysql51/$MYSQL_VERSION | |
mysql.server start | |
### reinstall DBD::mysql | |
curl -fsSL http://xrl.us/cpanm | perl - --reinstall -n DBD::mysql | |
### Build MySQL source | |
### Please FIXME!! | |
echo -e "\e[1;32mStarting build MySQL.\e[m" | |
cp `brew --cache`/mysql51-$MYSQL_VERSION.tar.gz /tmp | |
cd /tmp | |
tar xfz mysql51-$MYSQL_VERSION.tar.gz | |
cd mysql-$MYSQL_VERSION/ | |
./configure --without-docs --without-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/mysql51/$MYSQL_VERSION \ | |
--localstatedir=/usr/local/var/mysql --sysconfdir=/usr/local/etc --with-plugins=innobase,myisam \ | |
--with-extra-charsets=complex --with-ssl --with-readline --enable-assembler --enable-thread-safe-client \ | |
--enable-local-infile --enable-shared --with-partition --with-charset=utf8 | |
env CXXPLAGS="-O3 -march=core2 -msse4.1 -w -pipe -fno-omit-frame-pointer -felide-constructors" make | |
### Q4M | |
Q4M_VERSION=0.9.7 | |
echo -e "\e[1;32mStarting Q4M installation.\e[m" | |
cd /tmp | |
curl -O http://q4m.kazuhooku.com/dist/q4m-$Q4M_VERSION.tar.gz | |
tar zxf q4m-$Q4M_VERSION.tar.gz | |
cd q4m-$Q4M_VERSION | |
./configure --prefix=/usr/local/Cellar/mysql51/$MYSQL_VERSION --with-mysql=/tmp/mysql-$MYSQL_VERSION CFLAGS="-I/usr/local/Cellar/mysql51/$MYSQL_VERSION/include/mysql" CPPFLAGS="-I/usr/local/Cellar/mysql51/$MYSQL_VERSION/include/mysql" | |
make && make install | |
mysql -u root < support-files/install.sql | |
mysql -u root -e 'show plugins' | |
# perl run_tests.pl | |
echo -e "\e[1;32mdone.\e[m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment