Я немного почитал и обнаружил, что мне нужно установить debconf для mysql-community- сервер перед установкой. Мой скрипт делает следующее:
Код: Выделить всё
export DEBIAN_FRONTEND=noninteractive
apt-get install -y uuid-runtime debconf-utils gnupg wget
wget https://dev.mysql.com/get/mysql-apt-config_0.8.33-1_all.deb
dpkg -i mysql-apt-config_0.8.33-1_all.deb
apt-get update -y
MYSQL_PASS=$(uuidgen)
echo "mysql-community-server mysql-community-server/root-pass password $MYSQL_PASS" | debconf-set-selections
echo "mysql-community-server mysql-community-server/re-root-pass password $MYSQL_PASS" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server
Код: Выделить всё
hydra@hydra-debian-test:~$ sudo debconf-get-selections | grep mysql
mysql-apt-config mysql-apt-config/connectors-component string
mysql-apt-config mysql-apt-config/repo-codename select bookworm
mysql-apt-config mysql-apt-config/repo-distro select debian
mysql-apt-config mysql-apt-config/repo-url string http://repo.mysql.com/apt
mysql-apt-config mysql-apt-config/select-connectors select Enabled
mysql-apt-config mysql-apt-config/select-product select
mysql-apt-config mysql-apt-config/select-server select mysql-8.4-lts
mysql-apt-config mysql-apt-config/unsupported-platform select abort
mysql-community-server mysql-community-server/data-dir note
mysql-community-server mysql-community-server/re-root-pass password 8e80a9b1-4d5d-43f2-b2d8-f62b758d8f19
mysql-community-server mysql-community-server/remove-data-dir boolean false
mysql-community-server mysql-community-server/root-pass password 8e80a9b1-4d5d-43f2-b2d8-f62b758d8f19
mysql-community-server mysql-community-server/root-pass-mismatch error
mysql-community-server mysql-server/lowercase-table-names select
Код: Выделить всё
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Кто-нибудь знает, что я делаю неправильно или я что-то пропустил?
Подробнее здесь: https://stackoverflow.com/questions/793 ... -root-pass