Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 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
share|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
2  
Ah - it's in debconf-utils - install that and you should be sorted! –  Andy Smith Feb 3 '10 at 21:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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