Skip to content

Instantly share code, notes, and snippets.

@Jotschi
Last active November 13, 2017 17:02
Show Gist options
  • Save Jotschi/8792866 to your computer and use it in GitHub Desktop.
Save Jotschi/8792866 to your computer and use it in GitHub Desktop.
#!/bin/bash
DATADIR=/opt/mysql/server-5.6/data/
echo -e "\n * Stopping mysql"
/etc/init.d/mysql stop
killall mysqld
killall -9 mysqld
echo "Done."
echo -e "\n * Remounting tmpfs"
umount $DATADIR
umount $DATADIR
mount $DATADIR
echo "Done."
echo -e "\n * Inserting bare copy"
cp -ra /opt/mysql/server-5.6/databarecopy/* $DATADIR
echo "Done."
echo -e "\n * Starting mysql"
/etc/init.d/mysql start
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment