Last active
August 29, 2015 14:17
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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