aptitude install mysql-server while throw up a prompt asking for me to set the root password. I'd like to avoid this by specifying the password in the initial command. How do I do this?

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

Have a look at the debconf-set-selections manpage - it should do exactly what you're after.

You should be able to go onto a box with MySQL installed already, and do:-

debconf-get-selections | grep "^mysql-server" >mysql-server-sel.txt

Then copy it to your target box, and run:-

debconf-set-selections mysql-server-sel.txt
apt-get install mysql-server
link|improve this answer
1  
Thanks Andy for the hint. A previous question seems to have the specific answer: serverfault.com/questions/19367/… – pr1001 Feb 3 '10 at 20:57
D'oh! Beat me to it ;-) – Andy Smith Feb 3 '10 at 21:03
No worries. ;-) Unfortunately debconf-get-selections doesn't exist in the version of Ubuntu I'm running, so I'll have to hardcode the keynames. – pr1001 Feb 3 '10 at 21:07
Ah - it's in debconf-utils - install that and you should be sorted! – Andy Smith Feb 3 '10 at 21:08
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.