Skip to content

Instantly share code, notes, and snippets.

@ewdurbin
Last active August 29, 2015 14:06
Show Gist options
  • Save ewdurbin/33bc8f5031ceeb58e2cd to your computer and use it in GitHub Desktop.
Save ewdurbin/33bc8f5031ceeb58e2cd to your computer and use it in GitHub Desktop.
mysql_install_db --basedir=$(dirname $(mysql_config --variable=pkglibdir)) --datadir=/tmp/lol
mysqld --datadir=/tmp/lol --port=65530 --socket=/tmp/lol/mysql.sock --basedir=$(dirname $(mysql_config --variable=pkglibdir)) &
sleep 5
echo "CREATE DATABASE km3;" | mysql -u root -h 127.0.0.1 -P 65530
mysql -u root -h 127.0.0.1 -P 65530 km3 < core_db.sql
for migration in migrations/*; do mysql -u root -h 127.0.0.1 -P 65530 km3 < $migration; done
echo "show tables;" | mysql -u root -h 127.0.0.1 -P 65530 km3
echo "DROP DATABASE km3;" | mysql -u root -h 127.0.0.1 -P 65530
kill %1
rm -rf /tmp/lol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment