I was running mamp on el capitan 10.11.3. I decided to update mysql to version 5.7.11, so I ran this:
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
this is a script i found online. The tarball that I used was: mysql-5.7.11-osx10.10-x86_64.tar
now, I am unable to start mamp from the app, and when I run mysql in command line, I get :
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I solved it by installing mysql-server, so make sure that you have installed the mysql-server, not the mysql-client or something else.
That error means the file
doesn't exists, if you didn't install mysql-server, then the file would not exist. But if the mysql-server is already installed and is running, then you need to check the config files.
The config files are:
In
the socket file config may be
and in
the socket file config may be
So, remove or rename /etc/mysql/my.cnf, let mysql use /etc/my.cnf, then the problem may solved.