Skip to content

Instantly share code, notes, and snippets.

@michaeldyrynda
Last active August 29, 2015 14:17
Show Gist options
  • Save michaeldyrynda/0967f384cb331f8c8f8a to your computer and use it in GitHub Desktop.
Save michaeldyrynda/0967f384cb331f8c8f8a to your computer and use it in GitHub Desktop.
Simple command to add to your Homestead .bash_aliases file to create a new MySQL database
function newdb() {
if [[ "$1" ]]
then
mysql -uhomestead -p -e "CREATE DATABASE $1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci"
else
echo "Error: missing required parameter."
echo "Usage: "
echo " newdb dbname"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment