Last active
January 3, 2016 06:49
-
-
Save bbrothers/8425394 to your computer and use it in GitHub Desktop.
Vagrant mysql script from fideloper / Vaprobash with permissions for remote access
This file contains hidden or 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
#!/usr/bin/env bash | |
echo ">>> Setting MySQL Permissions" | |
[[ -z "$1" ]] && { echo "!!! MySQL root password not set. Check the Vagrant file."; exit 1; } | |
sudo sed -i '/^bind-address/s/bind-address.*=.*/bind-address = 0.0.0.0/' /etc/mysql/my.cnf | |
mysql -u root -p$1 -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '$1' WITH GRANT OPTION; FLUSH PRIVILEGES;" | |
sudo service mysql restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment