Installing Percona/MySQL unattended on Ubuntu

后端 未结 5 1616
闹比i
闹比i 2020-12-28 08:29

I can install MYSQL on Ubuntu without prompts with the code below:

dbpass=\"mydbpassword\"
export DEBIAN_FRONTEND=noninteractive
echo mysql-server-5.1 mysql-         


        
5条回答
  •  佛祖请我去吃肉
    2020-12-28 09:14

    Think I figured it out

    echo "percona-server-server-5.5 mysql-server/root_password password mypassword" | debconf-set-selections
    echo "percona-server-server-5.5 mysql-server/root_password_again password mypassword" | debconf-set-selections
    

    Don't use export DEBIAN_FRONTEND=noninteractive. If the debconf entries are correct, then you won't be prompted anyway. If they are incorrect and you use noninteractive then the prompt will continue with a blank password.

    Since Percona 'hooks into' MySQL check that it installed correctly using

    service mysql status
    

    and you will know it is percona if you see something like

    mysql.service - LSB: Start and stop the mysql (Percona Server) daemon

    Then finally check the password was set correctly

    mysql -u user -pmypassword
    

    EDIT: That said, for a newer version of percona, F21's answer worked for me. You can check the entries in /var/cache/debconf/passwords.dat

提交回复
热议问题