在Ubuntu上无人值守安装Percona/MySQL [英] Installing Percona/MySQL unattended on Ubuntu
问题描述
我可以在Ubuntu上安装MYSQL,而无需使用以下代码进行提示:
I can install MYSQL on Ubuntu without prompts with the code below:
dbpass="mydbpassword"
export DEBIAN_FRONTEND=noninteractive
echo mysql-server-5.1 mysql-server/root_password password $dbpass | debconf-set-selections
echo mysql-server-5.1 mysql-server/root_password_again password $dbpass | debconf-set-selections
apt-get -y install mysql-server
我在网上找到了一个带有debconf-set-selections的部分(可能在这里不记得了),到目前为止对我来说还可以.我并不是要了解它如何工作的专家,但是它确实可以工作.
The part with the debconf-set-selections I got somewhere online (could be here can't remember) and it has worked ok for me thus far. I'm not that much of an expert to understand how it works but it does.
但是,我想对Percona做同样的事情.我已经设置了apt软件包管理器,以将apt-get用于percona.所以现在我的代码如下:
However, I want to do the same thing for Percona. I've setup the apt package manager to deal with using apt-get for percona. So now my code is the following:
dbpass="dbpass" && export dbpass
export DEBIAN_FRONTEND=noninteractive
echo percona-server-server-5.5 percona-server-server-5.5/root_password password $dbpass | debconf-set-selections
echo percona-server-server-5.5 percona-server-server-5.5/root_password_again password $dbpass | debconf-set-selections
apt-get -y install percona-server-server-5.5
但是,Percona会安装但没有定义的密码.我知道我在debconf位中缺少了一些东西.
However, Percona installs but without a password as defined. I know I'm missing something in the debconf bit.
我希望在此提供一些指导.
I'd appreciate some guidance here.
提前谢谢.
推荐答案
debconf-prefix
的第二部分不应包含版本号:
The second part of the debconf-prefix
should not contain the version number:
echo percona-server-server-5.5 percona-server-server/root_password password $dbpass | sudo debconf-set-selections
echo percona-server-server-5.5 percona-server-server/root_password_again password $dbpass | sudo debconf-set-selections
对于5.6:
echo percona-server-server-5.6 percona-server-server/root_password password $dbpass | sudo debconf-set-selections
echo percona-server-server-5.6 percona-server-server/root_password_again password $dbpass | sudo debconf-set-selections
这篇关于在Ubuntu上无人值守安装Percona/MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!