Skip to content

Instantly share code, notes, and snippets.

@calvinjuarez
Created May 31, 2017 00:43
Show Gist options
  • Save calvinjuarez/a55bb22a0a2eae45f1d932347041c4df to your computer and use it in GitHub Desktop.
Save calvinjuarez/a55bb22a0a2eae45f1d932347041c4df to your computer and use it in GitHub Desktop.
Command line script for restarting MAMP's MySQL server.
#!/bin/bash
echo "Restarting MAMP's MySQL server."
# stop mysql
/Applications/MAMP/bin/stopMysql.sh
# MAMP needs this tmpdir to work, but doesn't create it itself
mkdir -p /Applications/MAMP/tmp/mysql/tmpdir/
# start mysql
/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.err &>/dev/null &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment