-
-
Save tobi-pb/b9426db51f262d88515c to your computer and use it in GitHub Desktop.
#!/bin/sh | |
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.24-osx10.9-x86_64.tar.gz | |
tar xfvz mysql-5.6* | |
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 | |
Also, if you have issues on Mac OS X Yosimite 10.10.4 with MAMP rebooting until you:
$ ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
You can:
crontab -e
@reboot ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
It works for me with " -h localhost " in last line.
Thanks!
awesome script.
ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock was the missing step for me.
If you are getting (errno: 13 - Permission denied)
error. Run below
sudo chown -R mysql:mysql /Applications/MAMP/db/mysql/
sudo chown -R mysql:mysql /Applications/MAMP/tmp/mysql/
You could update your script to get the latest version of MySQL (5.7.10)
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.10-osx10.10-x86_64.tar.gz
It's not working at all.
Looking for 'mysql' as: /Applications/MAMP/Library/bin/mysql
Looking for 'mysqlcheck' as: /Applications/MAMP/Library/bin/mysqlcheck
FATAL ERROR: Upgrade failed
Is this only working with MAMP Pro?
Update: I stand corrected
It is indeed working. But:
run ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
before doing anything else.
I had to manually execute each statement in the script one after another.
Don't execute the last one. Instead in MAMP: Tools>Upgrade MySQL Databases.
I got here because I wanted the combination of MAMP simplicity (including the choice between latest PHP5.x and PHP7), but with MySQL >= 5.6.5 (so I can set default values for created_at and updated_at).
Ultimately I successfully used daancart2quote's version above, with three changes:
- I manually (from UI) downloaded the 5.7.12 version from the website,
- I changes the various 5.6* in subsequent steps to 5.7*,
- I allowed MAMP to do the upgrade (Tools -> Upgrade Databases), from the MAMP UI (you will need to do "sudo chmod -R 777 /Applications/MAMP/db/mysql/" yourself).
Hopefully this is helpful to others.
If you encounter during the mysql_upgrade
step the following error:
(errno: 13 - Permission denied)
You can fix this by changing the ownership of the mysql
directory:
sudo chown -R _mysql:_mysql /Applications/MAMP/db/mysql
Is there anything similar for the windows version of MAMP?
Have to create a soft link or change it in my.cnf, otherwise MAMP cannot start or stop mysql properly.
ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
After running this script, I can't launch mamp anymore.
This is error message:
This is error log:
161218 9:39:38 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql/ is case insensitive
161218 9:39:38 [Note] Plugin 'FEDERATED' is disabled.
161218 9:39:39 InnoDB: The InnoDB memory heap is disabled
161218 9:39:39 InnoDB: Mutexes and rw_locks use GCC atomic builtins
161218 9:39:39 InnoDB: Compressed tables use zlib 1.2.3
161218 9:39:39 InnoDB: Initializing buffer pool, size = 128.0M
161218 9:39:39 InnoDB: Completed initialization of buffer pool
InnoDB: Error: checksum mismatch in data file ./ibdata1
161218 9:39:39 InnoDB: Could not open or create data files.
161218 9:39:39 InnoDB: If you tried to add new data files, and it failed here,
161218 9:39:39 InnoDB: you should now edit innodb_data_file_path in my.cnf back
161218 9:39:39 InnoDB: to what it was, and remove the new ibdata files InnoDB created
161218 9:39:39 InnoDB: in this failed attempt. InnoDB only wrote those files full of
161218 9:39:39 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
161218 9:39:39 InnoDB: remove old data files which contain your precious data!
161218 9:39:39 [ERROR] Plugin 'InnoDB' init function returned error.
161218 9:39:39 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
161218 9:39:39 [ERROR] Unknown/unsupported storage engine: InnoDB
161218 9:39:39 [ERROR] Aborting
161218 9:39:39 [Note] /Applications/MAMP/Library/bin/mysqld: Shutdown complete
161218 09:39:39 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
161218 09:43:17 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql
161218 9:43:17 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql/ is case insensitive
161218 9:43:17 [Note] Plugin 'FEDERATED' is disabled.
161218 9:43:17 InnoDB: The InnoDB memory heap is disabled
161218 9:43:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins
161218 9:43:17 InnoDB: Compressed tables use zlib 1.2.3
161218 9:43:17 InnoDB: Initializing buffer pool, size = 128.0M
161218 9:43:17 InnoDB: Completed initialization of buffer pool
InnoDB: Error: checksum mismatch in data file ./ibdata1
161218 9:43:17 InnoDB: Could not open or create data files.
161218 9:43:17 InnoDB: If you tried to add new data files, and it failed here,
161218 9:43:17 InnoDB: you should now edit innodb_data_file_path in my.cnf back
161218 9:43:17 InnoDB: to what it was, and remove the new ibdata files InnoDB created
161218 9:43:17 InnoDB: in this failed attempt. InnoDB only wrote those files full of
161218 9:43:17 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
161218 9:43:17 InnoDB: remove old data files which contain your precious data!
161218 9:43:17 [ERROR] Plugin 'InnoDB' init function returned error.
161218 9:43:17 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
161218 9:43:17 [ERROR] Unknown/unsupported storage engine: InnoDB
161218 9:43:17 [ERROR] Aborting
161218 9:43:17 [Note] /Applications/MAMP/Library/bin/mysqld: Shutdown complete
161218 09:43:17 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
any idea how to fix?
Thanks
+1 on getting this to run in windows, especially since mamp 4 isn't available for windows yet.
Thank you!
I had to replace
wget
forcurl
and add achmod
but it in the end it worked.