Guest User

Untitled

a guest
May 21st, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. #!/bin/bash
  2. apt-get update
  3.  
  4. # Install MySQL5
  5. aptitude -y install mysql-server mysql-client libmysqlclient15-dev
  6.  
  7. #!/bin/bash
  8. apt-get update
  9. apt-get install expect
  10.  
  11. VAR=$(expect -c '
  12. spawn apt-get -y install mysql-server
  13. expect "New password for the MySQL "root" user:"
  14. send "PasswordHerer"
  15. expect "Repeat password for the MySQL "root" user:"
  16. send "PasswordHerer"
  17. expect eof
  18. ')
  19.  
  20. echo "$VAR"
  21.  
  22. apt-get -y install mysql-client libmysqlclient15-dev
  23.  
  24. #For some reason important to restart - otherwise possible errors
  25.  
  26. /etc/init.d/mysql stop
  27. /etc/init.d/mysql start
  28.  
  29. #!/bin/bash
  30. export DEBIAN_FRONTEND=noninteractive
  31. apt-get -q -y install mysql-server
  32. echo "Give mysql server time to start up before we try to set a password..."
  33. sleep 5
  34. mysql -uroot -e <<EOSQL "UPDATE mysql.user SET Password=PASSWORD('yourpasswordhere') WHERE User='root'; FLUSH PRIVILEGES;"
  35. EOSQL
  36. echo "Done setting mysql password."
  37.  
  38. sudo DEBIAN_FRONTEND=noninteractive aptitude install -q -y mysql-server
  39.  
  40. #!/bin/bash
  41. INSTALLER_LOG=/var/log/my-installer.log
  42.  
  43. installnoninteractive(){
  44. sudo bash -c "DEBIAN_FRONTEND=noninteractive aptitude install -q -y $* >> $INSTALLER_LOG"
  45. }
  46.  
  47. installnoninteractive mysql-server
Add Comment
Please, Sign In to add comment