I've started playing with Vagrant and the first thing that I wanted to learn how to do is to install MySQL without the password prompts. I want this so if I hand off a project to someone else they don't even have to worry about what the password is set to. It turns out it's fairly simple:

debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password rootpass'
debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password rootpass'
apt-get update
apt-get -y install mysql-server-5.5

The other trick that I learned while figuring this out was the -y switch for apt-get which causes it to automatically reply yes to that prompt that asks if you're sure that you want to install the packages.