2016-03-15 169 views
4

是否可以將MAMP MySQL庫升級到5.7? 我目前正在運行5.6(我升級到使用mamp的升級腳本 ) 或者我需要本地安裝MySQL(el capitan)?升級到mamp的mysql 5.7

如果有人能指向我的方向正確...

謝謝!

回答

9

升級MAMP到MySQL 5.7

#!/bin/sh 

wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.10-osx10.10-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 "migrate to new version" 
/Applications/MAMP/Library/bin/mysql_upgrade -u root --password=root -h 127.0.0.1 
+0

跑好,但遇到錯誤:無法通過套接字「/tmp/mysql.sock」連接到本地MySQL服務器,所以我剛剛安裝了最新版本MAMP的具有5.6.35與utf8mb4。繼續前進 –

+0

任何幫助?這對我不起作用..我一直陷入困境。這裏是我的終端輸出:https://gist.github.com/NicolasVanhecke/26004baaf6c0d59a8c1254b22d60c9b8 – nclsvh

+0

@i_a我不得不添加一個符號鏈接來修復:'sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock/tmp/mysql.sock' – deweydb