Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- apt-get update
- # Install MySQL5
- aptitude -y install mysql-server mysql-client libmysqlclient15-dev
- #!/bin/bash
- apt-get update
- apt-get install expect
- VAR=$(expect -c '
- spawn apt-get -y install mysql-server
- expect "New password for the MySQL "root" user:"
- send "PasswordHerer"
- expect "Repeat password for the MySQL "root" user:"
- send "PasswordHerer"
- expect eof
- ')
- echo "$VAR"
- apt-get -y install mysql-client libmysqlclient15-dev
- #For some reason important to restart - otherwise possible errors
- /etc/init.d/mysql stop
- /etc/init.d/mysql start
- #!/bin/bash
- export DEBIAN_FRONTEND=noninteractive
- apt-get -q -y install mysql-server
- echo "Give mysql server time to start up before we try to set a password..."
- sleep 5
- mysql -uroot -e <<EOSQL "UPDATE mysql.user SET Password=PASSWORD('yourpasswordhere') WHERE User='root'; FLUSH PRIVILEGES;"
- EOSQL
- echo "Done setting mysql password."
- sudo DEBIAN_FRONTEND=noninteractive aptitude install -q -y mysql-server
- #!/bin/bash
- INSTALLER_LOG=/var/log/my-installer.log
- installnoninteractive(){
- sudo bash -c "DEBIAN_FRONTEND=noninteractive aptitude install -q -y $* >> $INSTALLER_LOG"
- }
- installnoninteractive mysql-server
Add Comment
Please, Sign In to add comment