sh 将MAMP 4升级到Mysql 5.7.18(在Sierra测试中)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 将MAMP 4升级到Mysql 5.7.18(在Sierra测试中)相关的知识,希望对你有一定的参考价值。

#!/bin/sh

wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-macos10.12-x86_64.tar.gz
tar xfvz mysql-5.7.18-macos10.12-x86_64.tar.gz

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

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 "Building Mysql 5.7 Folder"
sudo cp -r /Applications/MAMP/db/mysql56 /Applications/MAMP/db/mysql57
sudo rm -fr /Applications/MAMP/db/mysql57/mysql/innodb_*
sudo rm -fr /Applications/MAMP/db/mysql57/mysql/slave_*
sudo chmod -R o+rw  /Applications/MAMP/db/mysql57/
sed -i.bak 's/mysql56/mysql57/g' /Applications/MAMP/Library/bin/mysqld_safe

echo "Fixing Access (workaround)"
sudo chmod -R o+rw  /Applications/MAMP/tmp/mysql/

echo "Starting MySQL"
sudo /Applications/MAMP/Library/bin/mysqld_safe --port=3306 --socket=/Applications/MAMP/tmp/mysql/mysql.sock --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --log-error=/Applications/MAMP/logs/mysql_error_log

echo "Migrate, finaly, to new version"
sudo /Applications/MAMP/Library/bin/mysql_upgrade --user=root --password=root --port=3306 --socket=/Applications/MAMP/tmp/mysql/mysql.sock --force

以上是关于sh 将MAMP 4升级到Mysql 5.7.18(在Sierra测试中)的主要内容,如果未能解决你的问题,请参考以下文章

记升级mysql后的一次故障

从 5.0.12 更新到 5.7.18 后无法启动 mysql

升级到 Mountain Lion 后无法访问 MySQL 数据库(使用 MAMP)

mysql5.7安装升级

MAMP 无法升级 mysql 数据库

MAMP Pro 中有多个 MySQL 版本?