19

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!

Matt Gibson
  • 14,616
  • 7
  • 47
  • 79
Sabourinov
  • 297
  • 1
  • 3
  • 12

5 Answers5

10

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

Community
  • 1
  • 1
10

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%"
Matthias Kleine
  • 1,228
  • 17
  • 15
  • 3
    `$ ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock` was the missing step for me. – cfx Mar 08 '15 at 23:56
  • Worked for me! Thanks! – msrdjan Sep 04 '15 at 09:36
  • The `mysql_upgrade` step encountered many `Errcode: 13 - Permission denied` errors. I fixed this by running `sudo chown -R _mysql:_mysql /Applications/MAMP/db/mysql`. This was a wild guess inspired by [this answer](http://stackoverflow.com/a/4037158/5257399). – Birchlabs Oct 14 '16 at 16:51
  • Some advice: 1. Consider adding `set -e` to the start of this script, to terminate on first error. 2. @cfx's line `ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock` needs to run _before_ `sudo /Applications/MAMP/bin/stop.sh`. 3. `sudo /Applications/MAMP/bin/stop.sh` is only required if MAMP is running; it fails otherwise. 4. Remember to correct the password supplied to `mysql_upgrade`. – Birchlabs Oct 14 '16 at 17:42
  • A more recent MySQL 5.6 release (5.6.34, for Mac OS X 10.11 Sierra) can be found [here](https://dev.mysql.com/downloads/mysql/5.6.html). CDN link here: http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.34-osx10.11-x86_64.tar.gz – Birchlabs Oct 14 '16 at 17:44
10

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.

Matt Gibson
  • 14,616
  • 7
  • 47
  • 79
4

Download the official script by MAMP to update your MySQL to 5.6.12 http://blog-en.mamp.info/2015/07/how-to-use-mysql-5-6-with-mamp-and-mamp.html

For those of you who absolutely require MySQL 5.6 to be part of their development environment - maybe you are a Magento developer - we have released a shell script that updates the MySQL component of MAMP and MAMP PRO to v5.6. The script requires at least MAMP and MAMP PRO 3.3, older versions are untested.

Farzad Key
  • 61
  • 1
  • 9
0

Since MAMP 4.x is released, just use that version / upgrade your existing MAMP installation. MySQL 5.6 is already included.

Matthias Kleine
  • 1,228
  • 17
  • 15