• <bdo id='DwX7W'></bdo><ul id='DwX7W'></ul>

      <small id='DwX7W'></small><noframes id='DwX7W'>

    1. <tfoot id='DwX7W'></tfoot>
      <i id='DwX7W'><tr id='DwX7W'><dt id='DwX7W'><q id='DwX7W'><span id='DwX7W'><b id='DwX7W'><form id='DwX7W'><ins id='DwX7W'></ins><ul id='DwX7W'></ul><sub id='DwX7W'></sub></form><legend id='DwX7W'></legend><bdo id='DwX7W'><pre id='DwX7W'><center id='DwX7W'></center></pre></bdo></b><th id='DwX7W'></th></span></q></dt></tr></i><div id='DwX7W'><tfoot id='DwX7W'></tfoot><dl id='DwX7W'><fieldset id='DwX7W'></fieldset></dl></div>
      <legend id='DwX7W'><style id='DwX7W'><dir id='DwX7W'><q id='DwX7W'></q></dir></style></legend>
      1. 在没有密码提示的情况下在 Ubuntu 上安装 MySQL

        时间:2023-08-21
      2. <small id='sB8fE'></small><noframes id='sB8fE'>

            • <bdo id='sB8fE'></bdo><ul id='sB8fE'></ul>
                  <i id='sB8fE'><tr id='sB8fE'><dt id='sB8fE'><q id='sB8fE'><span id='sB8fE'><b id='sB8fE'><form id='sB8fE'><ins id='sB8fE'></ins><ul id='sB8fE'></ul><sub id='sB8fE'></sub></form><legend id='sB8fE'></legend><bdo id='sB8fE'><pre id='sB8fE'><center id='sB8fE'></center></pre></bdo></b><th id='sB8fE'></th></span></q></dt></tr></i><div id='sB8fE'><tfoot id='sB8fE'></tfoot><dl id='sB8fE'><fieldset id='sB8fE'></fieldset></dl></div>
                  <tfoot id='sB8fE'></tfoot>

                    <tbody id='sB8fE'></tbody>

                  <legend id='sB8fE'><style id='sB8fE'><dir id='sB8fE'><q id='sB8fE'></q></dir></style></legend>
                  本文介绍了在没有密码提示的情况下在 Ubuntu 上安装 MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  如何编写脚本在 Ubuntu 上安装 MySQL 服务器?

                  How do I write a script to install MySQL server on Ubuntu?

                  sudo apt-get install mysql 会安装,但也会要求在控制台输入密码.

                  sudo apt-get install mysql will install, but it will also ask for a password to be entered in the console.

                  如何以非交互式方式执行此操作?也就是写个脚本可以提供密码?

                  How do I do this in a non-interactive way? That is, write a script that can provide the password?

                  #!/bin/bash
                  sudo apt-get install mysql  # To install MySQL server
                  
                  # How to write script for assigning password to MySQL root user
                  # End
                  

                  推荐答案

                  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 mysql-server
                  

                  对于特定版本,例如mysql-server-5.6,您需要像这样指定版本:

                  For specific versions, such as mysql-server-5.6, you'll need to specify the version in like this:

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

                  对于 mysql-community-server,key 略有不同:

                  For mysql-community-server, the keys are slightly different:

                  sudo debconf-set-selections <<< 'mysql-community-server mysql-community-server/root-pass password your_password'
                  sudo debconf-set-selections <<< 'mysql-community-server mysql-community-server/re-root-pass password your_password'
                  sudo apt-get -y install mysql-community-server
                  

                  将 your_password 替换为所需的 root 密码.(似乎 your_password 也可以为空白 root 密码留空.)

                  Replace your_password with the desired root password. (it seems your_password can also be left blank for a blank root password.)

                  如果您的 shell 不支持 here-strings(zshksh93bash 支持它们),使用:

                  If your shell doesn't support here-strings (zsh, ksh93 and bash support them), use:

                  echo ... | sudo debconf-set-selections 
                  

                  这篇关于在没有密码提示的情况下在 Ubuntu 上安装 MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Microsoft SQL Server 2008 中 JOIN 与 APPLY 的相对效率 下一篇:无法在 mysql-apt-config [Ubuntu 14.04] 中选择“确定&

                  相关文章

                  最新文章

                  1. <legend id='VcFC4'><style id='VcFC4'><dir id='VcFC4'><q id='VcFC4'></q></dir></style></legend>

                    <small id='VcFC4'></small><noframes id='VcFC4'>

                    <i id='VcFC4'><tr id='VcFC4'><dt id='VcFC4'><q id='VcFC4'><span id='VcFC4'><b id='VcFC4'><form id='VcFC4'><ins id='VcFC4'></ins><ul id='VcFC4'></ul><sub id='VcFC4'></sub></form><legend id='VcFC4'></legend><bdo id='VcFC4'><pre id='VcFC4'><center id='VcFC4'></center></pre></bdo></b><th id='VcFC4'></th></span></q></dt></tr></i><div id='VcFC4'><tfoot id='VcFC4'></tfoot><dl id='VcFC4'><fieldset id='VcFC4'></fieldset></dl></div>
                    <tfoot id='VcFC4'></tfoot>

                        <bdo id='VcFC4'></bdo><ul id='VcFC4'></ul>