Today I ran
apt-get upgrade and there was an upgrade for MariaDB 10.1 ob Ubuntu Server 14.04 which failed:
Setting up libmysqlclient18 (10.1.9+maria-1~trusty) ... Setting up libmariadbclient18 (10.1.9+maria-1~trusty) ... Setting up mariadb-client-core-10.1 (10.1.9+maria-1~trusty) ... Setting up mariadb-client-10.1 (10.1.9+maria-1~trusty) ... Setting up mariadb-server-core-10.1 (10.1.9+maria-1~trusty) ... Setting up mariadb-server-10.1 (10.1.9+maria-1~trusty) ... Installing new version of config file /etc/init.d/mysql ... * Stopping MariaDB database server mysqld [ OK ] * Starting MariaDB database server mysqld [fail] 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~trusty); however: Package mariadb-server-10.1 is not configured yet. dpkg: error processing package mariadb-server (--configure): dependency problems - leaving unconfigured Processing triggers for ureadahead (0.100.0-16) ... Processing triggers for libc-bin (2.19-0ubuntu6.6) ... No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: mariadb-server-10.1 mariadb-server E: Sub-process /usr/bin/dpkg returned an error code (1)
This is a nightmare, I can't access the database anymore. I have tried removing and purging it and installing again, but it just always ends with the same error.
/var/log/syslog this has something to do with sockets and mysqld (after running
service mysql restart):
mysqld: 151127 11:51:07 [ERROR] mysqld got signal 11 ; ... mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended /etc/init.d/mysql: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in /etc/init.d/mysql: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed /etc/init.d/mysql: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111 "Connection refused")' /etc/init.d/mysql: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
/var/run/mysqld/mysqld.sock absolutely does exist. Also, I'm not sure why it says something about using
/etc/mysql/debian.cnf - my main mysql configuration file should actually be
/etc/mysql/my.cnf, no? I'm really out of ideas, any new ones would be appreciated!
Still couldn't figure out what the problem is and the upgrade still won't work, still giving the same error. Like some of the (now deleted) answers said, the only solution was to roll back to an older snapshot of the server. Fortunately, saving the database was as easy as copying everything from
/var/lib/mysql over to the other snapshot.
I hope there is or will be a solution to this, because I couldn't find anything on Google that worked for me.