How do I write a script to install MySQL server on Ubuntu?
sudo apt-get install mysql will install, but it will also ask for a password to be entered in
sudo apt-get install mysql
This should do the trick
export DEBIAN_FRONTEND=noninteractive sudo -E apt-get -q -y install mysql-server
Of course, it leaves you with a blank root password - so you'll want to run something like
mysqladmin -u root password mysecretpasswordgoeshere
Afterwards to add a password to the account.