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?
Asked
Active
Viewed 2,397 times
1 Answers
4
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
![](../../users/profiles/33745.webp)
Andy Smith
- 1,798
- 13
- 15
-
1Thanks Andy for the hint. A previous question seems to have the specific answer: http://serverfault.com/questions/19367/scripted-install-of-mysql-on-ubuntu/19399#19399 – pr1001 Feb 03 '10 at 20:57
-
D'oh! Beat me to it ;-) – Andy Smith Feb 03 '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 03 '10 at 21:07
-
2Ah - it's in `debconf-utils` - install that and you should be sorted! – Andy Smith Feb 03 '10 at 21:08