简体   繁体   English

自动安装MySQL-有什么方法可以设置root密码以避免提示

[英]Automating installation of MySQL - is there any way to set root password to avoid prompt

When I install mysql-client and/or mysql-server on Linux it prompts me for a root password on installation. 当我在Linux上安装mysql-client和/或mysql-server时,它会提示我输入安装时的root密码。 I'm wondering when people automate this process, for example by using something like Terraform, how is this managed? 我想知道何时人们可以自动执行此过程,例如通过使用Terraform之类的方法进行管理?

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

您是否不能创建环境变量(在构建环境中),然后使用空资源来运行带有所述变量的命令?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM