-
-
Save pepijnblom/dcccad436bbadcf63867 to your computer and use it in GitHub Desktop.
#!/bin/sh | |
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.15-osx10.11-x86_64.tar.gz | |
tar xfvz mysql-5.7* | |
echo "stopping mamp" | |
sudo /Applications/MAMP/bin/stop.sh | |
sudo killall httpd mysqld | |
echo "creating backup" | |
sudo rsync -arv --progress /Applications/MAMP ~/Desktop/MAMP-Backup | |
echo "copy bin" | |
sudo rsync -arv --progress mysql-5.7.*/bin/* /Applications/MAMP/Library/bin/ --exclude=mysqld_multi --exclude=mysqld_safe | |
echo "copy share" | |
sudo rsync -arv --progress mysql-5.7.*/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/ | |
sudo chmod -R o+rw "/Library/Application Support/appsolute/MAMP PRO/db/mysql/" | |
echo "starting mamp" | |
sudo /Applications/MAMP/bin/start.sh | |
echo "making symlink, enter sudo password" | |
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock | |
echo "migrate to new version" | |
/Applications/MAMP/Library/bin/mysql_upgrade -u root --password=root -h 127.0.0.1 | |
Had this problem :
migrate to new version
mysql_upgrade: [Warning] Using a password on the command line interface can be insecure.
mysql_upgrade: Got error: 2003: Can't connect to MySQL server on '127.0.0.1' (61) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
This fixed it :
sudo chmod -R 777 /Applications/MAMP/db/mysql/
/Applications/MAMP/Library/bin/mysql_upgrade --user=root --password=root --host=localhost --port=3306
Failing to start MySQL when you run MAMP PRO after system restart. (I am using macOS Sierra.)
System restart cleaned up /tmp and I had to run sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
to start MAMP PRO after each restart of my Mac.
Any idea why I have to run sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
each time? Normal MAMP PRO never do that.
Upgrading to Mysql 5.6 following http://blog-en.mamp.info/2015/07/how-to-use-mysql-5-6-with-mamp-and-mamp.html never required it.
/Applications/MAMP/Library/bin/mysql_upgrade --user=root --password=root --host=localhost --port=3306
Did not work for me. And sudo chmod -R 777 /Applications/MAMP/db/mysql/
also because it is actualy a sudo chmod -R 777 /Applications/MAMP/db/mysql56/
But after launching MAMP app it asked to upgrade MySQL and it runned upgrade ok.
Worked well for me, thanks!
Doesn't work for me.
I am using macOS Sierra and MAMP Pro 4.
@Kvartir54 did u manage to make it work for MAMP Pro 4?
A lot of MAMP crashes later, and some keyboard bashing and lots of combinations of the suggestions here, did eventually get this working with MAMP Pro 4. so it is possible. i did lose my databases in the progress, so you might want to back those up first.
Also didn't work for me.
I got this error Error: Failed while fetching Server version! Could be due to unauthorized access.
Hi guys, I've created a new Gist for version 4.1.1 of MAMP and migrating from MySQL 5.6 : https://gist.github.com/pedro-santiago/0d23167e50f95489103507725bb0fb14
Hope it helps someone ;)
@deweydb How did you manage to make it work?
180308 13:33:58 mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error.log'.
180308 13:33:58 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql56
2018-03-08T05:33:58.996372Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-03-08T05:33:58.998237Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2018-03-08T05:33:58.999395Z 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.7.15) starting as process 12828 ...
2018-03-08T05:33:59.014396Z 0 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql56/ is case insensitive
2018-03-08T05:33:59.026015Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-03-08T05:33:59.026112Z 0 [Note] InnoDB: Uses event mutexes
2018-03-08T05:33:59.026133Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-03-08T05:33:59.026151Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-03-08T05:33:59.028890Z 0 [Note] InnoDB: Number of pools: 1
2018-03-08T05:33:59.031586Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-03-08T05:33:59.033383Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-03-08T05:33:59.052874Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-03-08T05:33:59.069695Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-03-08T05:33:59.072734Z 0 [ERROR] InnoDB: Upgrade after a crash is not supported. This redo log was created before MySQL 5.7.9, and it appears corrupted. Please follow the instructions at http://dev.mysql.com/doc/refman/5.7/en/upgrading.html
2018-03-08T05:33:59.072808Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-03-08T05:33:59.382788Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-03-08T05:33:59.382870Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-03-08T05:33:59.382907Z 0 [ERROR] Failed to initialize plugins.
2018-03-08T05:33:59.382932Z 0 [ERROR] Aborting
2018-03-08T05:33:59.382978Z 0 [Note] Binlog end
2018-03-08T05:33:59.386145Z 0 [Note] Shutting down plugin 'CSV'
2018-03-08T05:33:59.390433Z 0 [Note] /Applications/MAMP/Library/bin/mysqld: Shutdown complete
180308 13:33:59 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
Hey thanks... for works perfectly on macOS High Sierra using this command at the end
sudo chmod -R 777 /Applications/MAMP/db/mysql/
I get broken pipe error wow
If possible, check if wget is present on MacOS machine. ;)
Great script
The last command fails and needs --socket=/Applications/MAMP/tmp/mysql/mysql.sock (maybe only on recent MAMP versions)