将MySql从5.6.25升级到5.7 MAMP

时间:2016-11-05 05:35:17

标签: mysql mamp

我正在尝试将我的MAMP sql从5.6升级到5.7,但遇到了问题。这是我正在关注的脚本:

#!/bin/sh

wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.9- 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 -a /Applications/MAMP ~/Desktop/MAMP-Backup

echo "copy bin"
sudo rsync -av mysql-5.7.*/bin/* /Applications/MAMP/Library/bin/ --exclude=mysqld_multi --exclude=mysqld_safe

echo "copy share"
sudo rsync -av 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/

echo "starting mamp"
ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
sudo /Applications/MAMP/bin/start.sh

echo "migrate to new version"
sudo chmod -R 777 /Applications/MAMP/db/mysql/
/Applications/MAMP/Library/bin/mysql_upgrade --user=root --password=root --host=localhost --port=3306

这是我在上次迁移部分的错误:

mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql
mysql_upgrade: [Warning] Using a password on the command line interface can be insecure.
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) while connecting to the MySQL server

升级过程遇到错误,无法继续。

我寻找/tmp/mysql.sock,但我只能找到/tmp/mysql/mysql.sock.lock

出现这种情况的原因是什么?

0 个答案:

没有答案