Advertisement
Guest User

mysql

a guest
Nov 5th, 2016
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.79 KB | None | 0 0
  1. # Configure MySQL Remote Access
  2.  
  3. sed -i '/^bind-address/s/bind-address.*=.*/bind-address = 0.0.0.0/' /etc/mysql/mysql.conf.d/mysqld.cnf
  4.  
  5. mysql --user="root" --password="secret" -e "GRANT ALL ON *.* TO root@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;"
  6. service mysql restart
  7.  
  8. mysql --user="root" --password="secret" -e "CREATE USER 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret';"
  9. mysql --user="root" --password="secret" -e "GRANT ALL ON *.* TO 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;"
  10. mysql --user="root" --password="secret" -e "GRANT ALL ON *.* TO 'homestead'@'%' IDENTIFIED BY 'secret' WITH GRANT OPTION;"
  11. mysql --user="root" --password="secret" -e "FLUSH PRIVILEGES;"
  12. mysql --user="root" --password="secret" -e "CREATE DATABASE homestead;"
  13. service mysql restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement