Is it possible to upgrade the MAMP MySQL library to 5.7? I am currently running 5.6 (which I upgraded to using MAMP’s upgrade script ) Or would I need to install MySQL natively on my system? (macOS 10.11 El Capitan)
If someone could point me in the right direction… Thanks!
UPDATE: Version 5.0 of MAMP now includes MySQL 5.7 already in the installer! Just upgrade your core MAMP setup and you are set to go with MySQL instead of having to jump through technical hoops like this.
Leaving answer below as a reference for anyone who needs it.
While I have read this answers and comments here—as well as some similar linked tutorials on GitHub and such—there were a few things that confused me in some of the tutorials. Such as instructions to set
chmod -O o+rw
and even a comment about creating a symbolic link to/tmp/mysql.sock
; why do that when MAMP out of the box should be self contained and not require such changes? So here are the instructions I have put together based on my experience getting MySQL upgraded for MAMP 4.4.1 on mac OS 10.3.4 (High Sierra).First, get a copy of the macOS binaries for MySQL 5.7; note that as of me posting this answer MySQL 5.7.22 is the current version so adjust this URL to whatever new version you might want to use:
Decompress it like this:
Copy the
bin/
andshare/
stuff into MAMP via Rsync like this:Copy your existing MySQL 5.6 database directory like this; just note that the
mysql56
directory is temporarily needed during the upgrade but can be discarded after the rest of the MySQL 5.7 upgrade is done:Once that is done, get rid of MySQL database specific binaries like this for upgrade:
And instead of changing permissions to
o+rw
just change the owner of the DB directory to your current user; this matches how MAMP installs this stuff:Now run this Sed command to adjust the
mysqld_safe
script to point to the new MySQL 5.7 path; you could probably just open this file up in a text editor and change all instances ofmysql56
tomysql57
as well:Finally, if you use MAMP and set a
my.cnf
file, that should be set in/Applications/MAMP/conf/my.cnf
… But by doing this upgrade, the default search path of themy.cnf
in MAMP will be/usr/local/mysql/etc/
instead of the expected/Applications/MAMP/conf/
since that is where the new binary expects it to be set. Clearly we’re not going to recompile MySQL at this point so the cleanest/simplest thing to do to make your MAMP setup truly portable again is to change this line in thestartMysql.sh
from this:To this; note we are adding the
--defaults-extra-file=
option before all the otgers:With all of that command line work done, launch MAMP via the application, start the MySQL and Apache servers and then drop back into the command like to run this command to upgrade the databases:
And finally run this command to get the
mysql.sock
properly set for MAMP path instead of that/tmp/mysql.sock
path:When this is all done, and you have confirmed MySQL is running as expected, just toss the old MySQL 5.6 directory like this:
With all that done you should all be set to cleanly use MySQL 5.7 under MAMP 4.4.1.
I encountered problems upgrading to MySQL 5.7.22 described in the excellent workout of JakeGould.
The update procedure worked well on El Capitan with MySQL 5.7.18.
I have written an updated bash script for this procedure:
Upgrade MAMP to Mysql 5.7