Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAMP - Upgrade to MySQL 5.6

Tags:

mysql

macos

mamp

Is it possible to upgrade the MAMP MySQL library to 5.6 ?

Or I'll need to install MySQL natively (Lion) ?

If someone could point me in the right direction...

Thanks!

like image 948
Sabourinov Avatar asked Feb 15 '12 05:02

Sabourinov


3 Answers

The latest MAMP has MySQL 5.5.9. Given the occasional wonkiness of MAMP and general lack of support, I'd be hesitant to mess about with it internally to upgrade it.

However, there's nothing wrong with disabling the MySQL that comes with it, installing 5.6 separately, then pointing it at the MAMP MySQL data files. You'll need to remember to run the upgrade script that comes with MySQL, so probably best to take a copy of the MAMP data first and move it to the data folder of the new MySQL install.

The only reason to use MAMP in the first place is that messing about with the built in copy of Apache can make file sharing stop working, so it's easier to use MAMP instead on a different port, but this doesn't apply to MySQL so you should be OK.

like image 160
Matt Gibson Avatar answered Oct 24 '22 22:10

Matt Gibson


It is possible. I have it running. Install MySQL

http://dev.mysql.com/downloads/mysql/

Download the Mac version

Then change your mysql.sock in MAMP to the new one

mv /Applications/MAMP/tmp/mysql/mysql.sock /Applications/MAMP/tmp/mysql/mysql.sock.back

ln -s /var/mysql/mysql.sock /Applications/MAMP/tmp/mysql/mysql.sock

Restart MAMP

like image 44
Kimberely Thomas Avatar answered Oct 24 '22 22:10

Kimberely Thomas


Found a solution on gist and modified it a bit:

#!/bin/sh

wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.22-osx10.9-x86_64.tar.gz
tar xfvz mysql-5.6*
rm mysql-5.6.22-osx10.9-x86_64.tar.gz

echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld

echo "creating backup"
sudo rsync -a /Applications/MAMP ~/Desktop/MAMP-Backup

echo "copy bin"
sudo rsync -av mysql-5.6.*/bin/* /Applications/MAMP/Library/bin/ --exclude=mysqld_multi --exclude=mysqld_safe 

echo "copy share"
sudo rsync -av mysql-5.6.*/share/* /Applications/MAMP/Library/share/

echo "fixing access (workaround)"
sudo chmod -R o+rw  /Applications/MAMP/db/mysql/ 
sudo chmod -R o+rw  /Applications/MAMP/tmp/mysql/

echo "starting mamp"
sudo /Applications/MAMP/bin/start.sh

echo "migrate to new version"
/Applications/MAMP/Library/bin/mysql_upgrade -u root --password=root -h 127.0.0.1

https://gist.github.com/tobi-pb/b9426db51f262d88515c

If everything worked, you have to delete the mySQL backup on your desktop. You can check the current mySQL-Version by executing the following command on your local server:

SHOW VARIABLES LIKE "%version%"
like image 27
Matthias Kleine Avatar answered Oct 24 '22 20:10

Matthias Kleine