Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "installing mysql"
- sudo apt-get install -y mysql-server libapache2-mod-auth-mysql php5-mysql
- sudo mysql_install_db
- /usr/bin/mysql_secure_installation
- echo "Configuring mysql to accept outside ip's"
- (grep -v "bind-address = 127.0.0.1" /etc/mysql/my.cnf && echo "#bind-address = 127.0.0.1") > /etc/mysql/my.cnf.1
- ##Clean up Step
- rm /etc/mysql/my.cnf
- mv /etc/mysql/my.cnf.1 /etc/mysql/my.cnf
- read -p "Please enter mysql password: " password
- echo "You entered: $password continuing with install"
- mysql -uroot -p"$password" -e "use mysql"
- mysql -uroot -p"$password" -e "GRANT ALL ON *.* to root@'%' IDENTIFIED BY '$password';"
- mysql -uroot -p"$password" -e "FLUSH PRIVILEGES;"
- service mysql restart
- ufw allow 3306
- ufw allow 80
Advertisement
Add Comment
Please, Sign In to add comment