Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #This script installs mysql (latest build)
- #Install MYSQL Server
- mysql_pass=mymysqlpass
- export DEBIAN_FRONTEND=noninteractive
- debconf-set-selections <<< 'mysql-server-5.1 mysql-server/root_password password '$mysql_pass''
- debconf-set-selections <<< 'mysql-server-5.1 mysql-server/root_password_again password '$mysql_pass''
- apt-get -y install mysql-server
- #Configure Password and Settings for Remote Access
- cp /etc/mysql/my.cnf /etc/mysql/my.bak.cnf
- ip=`ifconfig eth0 | grep "inet addr"| cut -d ":" -f2 | cut -d " " -f1` ; sed -i "s/(bind-address[t ]*)=.*/1= $ip/" /etc/mysql/my.cnf
- mysql -uroot -e "UPDATE mysql.user SET Password=PASSWORD('"$mysql_pass"') WHERE User='root'; FLUSH PRIVILEGES;"
- sleep 10
- mysql -uroot -p$mysql_pass -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '"$mysql_pass"'; FLUSH PRIVILEGES;"
- #Restart
- service mysql restart
- echo "MySQL Installation and Configuration is Complete."
- echo "mysql-server mysql-server/root_password password strangehat" | sudo debconf-set-selections
- echo "mysql-server mysql-server/root_password_again password strangehat" | sudo debconf-set-selections
- sudo apt-get install mysql-server
- sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password my_password'
- sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password my_password'
- sudo apt-get -y install mysql-server
- export DEBIAN_FRONTEND=noninteractive
- mysql_pass="mymysqlpass"
- "mysql-server-5.1 mysql-server/root_password password '$mysql_pass'"
- sudo debconf-set-selections <<< "mysql-server-5.5 mysql-server/root_password password ''"
- sudo debconf-set-selections <<< "mysql-server-5.5 mysql-server/root_password_again password ''"
- sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password ''"
- sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ''"
- export DEBIAN_FRONTEND=noninteractive
- sudo -E apt-get install -y -q mysql-server libmysqlclient-dev
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement