Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a way to pass the desired MYSQL password to the prompts in the apt-get install lamp-server^ package in a single command line?

Note: I tried finding the package repository to read up on it, but I can't find it.

share|improve this question
1  
No. This must be done when you'll configure your database after installation. –  muniz95 Mar 15 at 18:37
    
@muniz95 Actually, if you read the answer below you'll see that this isn't the case. –  Seth Mar 23 at 0:10
    
Well, living and learning... –  muniz95 Mar 24 at 14:31

1 Answer 1

up vote 4 down vote accepted

You can preset the password:

sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password your_password'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password your_password'
sudo apt-get -y install lamp-server^

This is adapted from a SO Question which has a few variants on this idea.

share|improve this answer

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.