0

When I install mysql-client and/or mysql-server on Linux it prompts me for a root password on installation. I'm wondering when people automate this process, for example by using something like Terraform, how is this managed?

For example, if whatever package management system you are using runs the following command, is there anything that can be added to the command to use an environment variable, or a value in the configuration, file so that the password is defined before (in the config), and set during the installation process?

sudo apt-get install mysql-client
nmh
  • 491
  • 2
  • 8
  • 23
  • Check here https://stackoverflow.com/questions/7739645/install-mysql-on-ubuntu-without-a-password-prompt or here https://stackoverflow.com/questions/31805195/script-install-mysql-server-without-password-prompt-via-centos depending on your OS – Brandon Miller Jun 22 '18 at 00:54

1 Answers1

0

Could you not create an environment variable (in your build env) then use a null resource to run the command with said variable?

Liamptk
  • 1
  • 1