9

I have tried to install ISPConfig3 on Debian Jessie 8.1, and it couldnt connect to mySQL (mariaDB 10.1). So I CTRL+C to kill the install and I tried to manually login to mySQL, but I failed. It was complaining about the socket. So I purged and removed mariaDB and mySQL:

service mysql stop
apt-get --purge remove "mysql*"
mv /etc/mysql/ /tmp/mysql_configs/
apt-get remove --purge mysql*
apt-get autoremove
apt-get autoclean
service apache2 restart
apt-get update

Inside the source.list I have (added last two lines) (nano /etc/apt/sources.list):

deb http://debian.mirror.constant.com/ jessie main contrib non-free
deb-src http://debian.mirror.constant.com/ jessie main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

deb [arch=amd64,i386] http://ftp.utexas.edu/mariadb/repo/10.0/debian jessie main
deb-src http://ftp.utexas.edu/mariadb/repo/10.0/debian jessie main

Then I followed the commands given by MariaDB:

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
sudo apt-get update
sudo apt-get install mariadb-server

I get the following error:

Setting up mariadb-server-10.1 (10.1.9+maria-1~jessie) ...
2015-12-15 11:26:57 140472422967232 [Note] /usr/sbin/mysqld (mysqld 10.1.9-MariaDB-1~jessie) starting as process 12018 ...
2015-12-15 11:26:57 140472422967232 [Note] Using unique option prefix 'myisam_recover' is error-prone and can break in the future. Please use the full name 'myisam-recover-options' instead.
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: The InnoDB memory heap is disabled
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: Memory barrier is not used
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: Compressed tables use zlib 1.2.8
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: Using Linux native AIO
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: Using CPU crc32 instructions
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: Initializing buffer pool, size = 256.0M
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: Completed initialization of buffer pool
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: Highest supported file format is Barracuda.
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: 128 rollback segment(s) are active.
2015-12-15 11:26:57 140472422967232 [Note] InnoDB: Waiting for purge to start
2015-12-15 11:26:57 140472422967232 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.26-74.0 started; log sequence number 19615081045
2015-12-15 11:26:57 140471636559616 [Note] InnoDB: Dumping buffer pool(s) not yet started
2015-12-15 11:26:58 140472422967232 [Note] Plugin 'FEEDBACK' is disabled.
Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mariadb-server-10.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
 mariadb-server depends on mariadb-server-10.1 (= 10.1.9+maria-1~jessie); however:
  Package mariadb-server-10.1 is not configured yet.

dpkg: error processing package mariadb-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mariadb-server-10.1
 mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

How can I fix it?

7 Answers 7

15

Try the following:

apt-get remove --purge mysql*
apt-get remove --purge mysql
apt-get remove --purge mariadb
apt-get remove --purge mariadb*
apt-get --purge remove mariadb-server
apt-get --purge remove python-software-properties

Note: When prompted if you want to dump your current Databases, say no. But you can deconfigure the phpmyadmin database easily.

Install everything from fresh: Add the following to your /etc/apt/sources.list file:

deb [arch=amd64,i386] http://ftp.utexas.edu/mariadb/repo/10.1/debian jessie main
deb-src http://ftp.utexas.edu/mariadb/repo/10.1/debian jessie main

Then,

apt-get install python-software-properties
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
apt-get install software-properties-common
apt-get install mariadb-server mariadb-client

Once your are done you should be able to run mysql -V and see something like:

mysql  Ver 15.1 Distrib 10.1.9-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
2
  • apt-get remove --purge mysql will remove all existing databases too ? Oct 22, 2018 at 5:27
  • python-software-properties and software-properties-common have got nothing to do with mysql/maridab.
    – Nimrod
    Feb 6, 2022 at 5:26
3

I just got this error. For those new here.

The problem was from mysql database missing. Because I deleted the folders /var/lib/mysql/ and /etc/mysql/.

I just executed sudo mysql_install_db. Then start the MySql service sudo service mysql start. It should work.

If you get error when executed sudo mysql_install_db, execute sudo mkdir /etc/mysql/conf.d/. Then start again.

2

I had a very similar issue installing MariaDB server 10.0 on Ubuntu 16.04 upgraded from Ubuntu 14.04.

Setting up mariadb-server-10.0 (10.0.31-0ubuntu0.16.04.2) ...
dpkg: error processing package mariadb-server-10.0 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
 mariadb-server depends on mariadb-server-10.0 (>= 10.0.31-0ubuntu0.16.04.2); however:
  Package mariadb-server-10.0 is not configured yet.

dpkg: error processing package mariadb-server (--configure):
 dependency problems - leaving unconfigured

@user3502626's answer gave a hint using sudo mysql_install_db, which provided a new error:

/usr/sbin/mysqld: Can't read dir of '/etc/mysql/mariadb.conf.d/' (Errcode: 13 "Permission denied")

Searching for that error led to a Debian bug report that pointed the problem at AppArmor, and could be solved with:

$ echo -n "/usr/sbin/mysqld" | sudo tee /sys/kernel/security/apparmor/.remove
$ apt install -f
$ apparmor_parser -r /etc/apparmor.d/usr.sbin.mysqld

That installed MariaDB properly.

1

This situation could occur if the timeout for the init script was too short. For example, see MDEV-9382, a situation where the timeout was 30 seconds, but the server was taking 48 seconds to start.

On systems where systemd is not enabled/supported :

The timeout can be increased by setting MYSQLD_STARTUP_TIMEOUT either directly in the script or via the command line. In MariaDB 10.1.13 and later versions, the init script also sources /etc/default/mariadb, so it can also be used to set MYSQLD_STARTUP_TIMEOUT to persistently change the startup timeout. The default timeout has been increased from 30s to 60s in MariaDB 10.1.13.

On systems that support systemd:

The startup timeout can be increased by setting TimeoutStartSec systemd option. If there are some systemd settings to override or to set, create a file /etc/systemd/system/mariadb.service.d/XXXX.conf file where XXXX is something meaningful to you and place the configuration option(s) in an appropriate section, usually [Service]. If a systemd option is a list you may need to set this to empty before you set the replacement values, e.g.:

[Service]

TimeoutStartSec=
TimeoutStartSec=60

After any configuration change systemctl daemon-reload will be required to pick up the changes.

Source: https://mariadb.com/kb/en/mariadb/apt-upgrade-fails-but-the-database-is-running/

1

Do you have a .my.cnf file in your home directory? This was causing the error for me. I simply delete it and restart the installation process.

1
sudo apt-get dist-upgrade

..resolved this for me

Use this with caution because dist-upgrade may remove a package if there's a conflict between packages or dependencies that can't be satisfied. dist-upgrade will tell you the list of packages that it deems fit for installation and removal. Observe the list before making changes

Credits to Florian

1
  • It downloads something new, but not changes real version. Sep 21, 2018 at 12:39
0

This usually happens when you didn't remove mysql completely before trying to use mariadb. So try this.

sudo apt remove --purge mysql*
sudo apt remove --purge mysql
sudo apt remove --purge mariadb
sudo apt remove --purge mariadb*
sudo apt --purge remove mariadb-server

Then try re installing it again

sudo apt install mariadb-server mariadb-client

You must log in to answer this question.

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