0

I was able to install mysql server 8 until a couple of weeks ago on a fresh Debian Buster installation.

sudo apt update
export DEBIAN_FRONTEND=noninteractive
sudo apt full-upgrade -y
sudo apt autoremove -y

sudo apt install gnupg -y
wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.17-1_all.deb
sudo -E dpkg -i mysql-apt-config_0.8.17-1_all.deb
sudo apt update
sudo -E apt install -y mysql-server

But something seems to have changed either in Debian Buster 10.9 or mysql-apt-config_0.8.17-1_all.deb that is causing the error below.

Error:

update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up mysql-community-client (8.0.24-1debian10) ...
Setting up mysql-client (8.0.24-1debian10) ...
Setting up mysql-community-server (8.0.24-1debian10) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
dpkg: error processing package mysql-community-server (--configure):
 installed mysql-community-server package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-community-server (= 8.0.24-1debian10); however:
  Package mysql-community-server is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10) ...
Errors were encountered while processing:
 mysql-community-server
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm completely stuck, as I don't understand the error message. Because the configuration should happen after the installation like this:

sudo systemctl start mysql.service
sudo systemctl enable mysql.service
SECURE_MYSQL=$(expect -c "
set timeout 10
spawn sudo mysql_secure_installation
expect \"Would you like to setup VALIDATE PASSWORD plugin?\"
send \"n\r\"
expect \"New password:\"
send \"$DB_ROOT_PASSWORD\r\"
expect \"Re-enter new password:\"
send \"$DB_ROOT_PASSWORD\r\"
expect \"Remove anonymous users?\"
send \"y\r\"
expect \"Disallow root login remotely?\"
send \"y\r\"
expect \"Remove test database and access to it?\"
send \"y\r\"
expect \"Reload privilege tables now?\"
send \"y\r\"
expect eof
")
echo "$SECURE_MYSQL"

What am I missing please?

UPDATE:

As per comment, this is the result of my investigation:

sudo bash -x /var/lib/dpkg/info/mysql-community-server.postinst
+ . /usr/share/debconf/confmodule
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ '[' '' ']'
++ exec /usr/share/debconf/frontend /var/lib/dpkg/info/mysql-community-server.postinst
Use of uninitialized value $action in string eq at /usr/share/debconf/frontend line 27.

vim /usr/share/debconf/frontend

#!/usr/bin/perl -w
# This file was preprocessed, do not edit!


use strict;
use Debconf::Db;
use Debconf::Template;
use Debconf::AutoSelect qw(:all);
use Debconf::Log qw(:all);

Debconf::Db->load;

debug developer => "frontend started";

my $frontend=make_frontend();

shift @ARGV if $ARGV[0] eq '--';

my $package;
my $no_title=0;
if ($ENV{DEBCONF_PACKAGE}) {
        $package=$ENV{DEBCONF_PACKAGE};
}
elsif ($ARGV[0]=~m!^.*/(.*?)\.(?:postinst|postrm|prerm)$!) {
        $package=$1;
        my $action=$ARGV[1];
        $no_title=1 if $action eq 'triggered';
}
2
  • mysql-community-server package post-installation script subprocess returned error exit status 1 Look at the postint script, it is failing. /var/lib/dpkg/info/mysql-community-server.postinst try running it manually maybe with bash -x.
    – Zoredache
    May 10, 2021 at 7:54
  • Thanks, I have updated the question based on your suggestion.
    – Houman
    May 10, 2021 at 8:08

1 Answer 1

2

I found the reason. The error message is a red herring.

I was trying to install this on an AWS t3.nano instance, and 512 MB RAM are not enough for mysql8.

I just reinstalled it on a t3.micro, which has 1 GB of memory, and the scripts installs perfectly.

I hope this helps somebody else. Thanks

1
  • 1
    Exactly same boat - I tried a T3a nano. Hit the error, tried just about everything I could find, and finally this is the only solution that worked.
    – zehawk
    Oct 17, 2021 at 17:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .