6

I tried o install MariaDB on my Ubuntu 12.04 server. First it gave dependency issues and I fixed it by following this question : https://stackoverflow.com/questions/16214517/installing-mariadb-unmet-dependencies-mariadb-server-5-5

But when installing mariadb-server, it fails to start the mysqld. Here is the apt log :

    root@sinha:/etc/apt# sudo apt-get install mariadb-server
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following extra packages will be installed:
      libdbd-mysql-perl libmariadbclient18 libmysqlclient18 mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common mariadb-server-10.0 mariadb-server-core-10.0 mysql-common
    Suggested packages:
      tinyca mailx mariadb-test
    The following NEW packages will be installed:
      libdbd-mysql-perl libmariadbclient18 mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common mariadb-server mariadb-server-10.0 mariadb-server-core-10.0
    The following packages will be upgraded:
      libmysqlclient18 mysql-common
    2 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
    Need to get 30.8 MB of archives.
    After this operation, 105 MB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Get:1 http://mirrors.supportex.net/mariadb/repo/10.0/ubuntu/ precise/main mysql-common all 10.0.1-mariadb1~precise [8,826 B]
    Get:2 http://mirrors.supportex.net/mariadb/repo/10.0/ubuntu/ precise/main mariadb-common all 10.0.1-mariadb1~precise [3,304 B]
    Get:3 http://lk.archive.ubuntu.com/ubuntu/ precise/main libdbd-mysql-perl amd64 4.020-1build2 [106 kB]
    Get:4 http://mirrors.supportex.net/mariadb/repo/10.0/ubuntu/ precise/main libmariadbclient18 amd64 10.0.1-mariadb1~precise [846 kB]
    Get:5 http://mirrors.supportex.net/mariadb/repo/10.0/ubuntu/ precise/main libmysqlclient18 amd64 10.0.1-mariadb1~precise [2,956 B]
    Get:6 http://mirrors.supportex.net/mariadb/repo/10.0/ubuntu/ precise/main mariadb-client-core-10.0 amd64 10.0.1-mariadb1~precise [1,814 kB]
    Get:7 http://mirrors.supportex.net/mariadb/repo/10.0/ubuntu/ precise/main mariadb-client-10.0 amd64 10.0.1-mariadb1~precise [5,103 kB]
    Get:8 http://mirrors.supportex.net/mariadb/repo/10.0/ubuntu/ precise/main mariadb-server-core-10.0 amd64 10.0.1-mariadb1~precise [5,517 kB]
    Get:9 http://mirrors.supportex.net/mariadb/repo/10.0/ubuntu/ precise/main mariadb-server-10.0 amd64 10.0.1-mariadb1~precise [17.4 MB]
    Get:10 http://mirrors.supportex.net/mariadb/repo/10.0/ubuntu/ precise/main mariadb-server all 10.0.1-mariadb1~precise [2,992 B]
    Fetched 30.8 MB in 1s (17.0 MB/s)      
    Preconfiguring packages ...
    (Reading database ... 119368 files and directories currently installed.)
    Preparing to replace mysql-common 5.5.31-0ubuntu0.12.04.1 (using .../mysql-common_10.0.1-mariadb1~precise_all.deb) ...
    Unpacking replacement mysql-common ...
    Selecting previously unselected package mariadb-common.
    Unpacking mariadb-common (from .../mariadb-common_10.0.1-mariadb1~precise_all.deb) ...
    Selecting previously unselected package libmariadbclient18.
    Unpacking libmariadbclient18 (from .../libmariadbclient18_10.0.1-mariadb1~precise_amd64.deb) ...
    Preparing to replace libmysqlclient18 5.5.31-0ubuntu0.12.04.1 (using .../libmysqlclient18_10.0.1-mariadb1~precise_amd64.deb) ...
    Unpacking replacement libmysqlclient18 ...
    Selecting previously unselected package libdbd-mysql-perl.
    Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.020-1build2_amd64.deb) ...
    Selecting previously unselected package mariadb-client-core-10.0.
    Unpacking mariadb-client-core-10.0 (from .../mariadb-client-core-10.0_10.0.1-mariadb1~precise_amd64.deb) ...
    Selecting previously unselected package mariadb-client-10.0.
    Unpacking mariadb-client-10.0 (from .../mariadb-client-10.0_10.0.1-mariadb1~precise_amd64.deb) ...
    Selecting previously unselected package mariadb-server-core-10.0.
    Unpacking mariadb-server-core-10.0 (from .../mariadb-server-core-10.0_10.0.1-mariadb1~precise_amd64.deb) ...
    Processing triggers for man-db ...
    Setting up mysql-common (10.0.1-mariadb1~precise) ...
    Installing new version of config file /etc/mysql/my.cnf ...
    Setting up mariadb-common (10.0.1-mariadb1~precise) ...
    Selecting previously unselected package mariadb-server-10.0.
    (Reading database ... 119534 files and directories currently installed.)
    Unpacking mariadb-server-10.0 (from .../mariadb-server-10.0_10.0.1-mariadb1~precise_amd64.deb) ...
    Selecting previously unselected package mariadb-server.
    Unpacking mariadb-server (from .../mariadb-server_10.0.1-mariadb1~precise_all.deb) ...
    Processing triggers for ureadahead ...
    ureadahead will be reprofiled on next reboot
    Processing triggers for man-db ...
    Setting up libmysqlclient18 (10.0.1-mariadb1~precise) ...
    Setting up libdbd-mysql-perl (4.020-1build2) ...
    Setting up libmariadbclient18 (10.0.1-mariadb1~precise) ...
    Setting up mariadb-client-core-10.0 (10.0.1-mariadb1~precise) ...
    Setting up mariadb-client-10.0 (10.0.1-mariadb1~precise) ...
    Setting up mariadb-server-core-10.0 (10.0.1-mariadb1~precise) ...
    Setting up mariadb-server-10.0 (10.0.1-mariadb1~precise) ...
     * Stopping MariaDB database server mysqld                                                                                                                                                              [ OK ] 
    130427 13:43:14 [Note] Plugin 'InnoDB' is disabled.
    130427 13:43:14 [Note] Plugin 'FEEDBACK' is disabled.
     * Starting MariaDB database server mysqld                                                                                                                                                              [fail] 
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing 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; however:
      Package mariadb-server-10.0 is not configured yet.
    dpkg: error processing mariadb-server (--configure):
     dependency problems - leaving unconfigured
    Processing triggers for libc-bin ...
    ldconfig deferred processing now taking place
    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.0
     mariadb-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)

Tried re installing mariadb-server, purged everything... removed mysql packages, installed mariadb-server-5.5... Nothing works.

14

This worked for me:

sudo apt-get purge mysql* mariadb*
4

Just fixed the problem by purging mysql* and mariadb*. Then removing all the traces of mysql by searching :

find / -name mysql*

There were some leftovers in lib. After removing them, rebooted the server and installed mariadb again! It worked.

  • This fixed it for me! I purged mysql* and mariadb*, removed a /var/lib/mysql directory and rebooted. MariaDB then installed fine. Thank you :) – Elliot Lings Apr 28 '16 at 23:18
  • this didn't help me until I # apt-get upgrade whole system – vladkras Jun 18 '16 at 11:02
2

I had the same issue when attempting to install MariaDB 10 in Ubuntu 12.04.4 LTS, and neither of the other solutions worked for me. The root cause turned out to be a lack of memory (I had a VPS with 512MB).

I found this out by looking in /var/log/syslog after attempting to install MariaDB, and I saw this:

mysqld_safe[29684]: InnoDB: mmap(274726912 bytes) failed; errno 12
mysqld_safe[29684]: 140420 17:11:03 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
mysqld_safe[29684]: 140420 17:11:03 [ERROR] Plugin 'InnoDB' init function returned error.
mysqld_safe[29684]: 140420 17:11:03 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
mysqld_safe[29684]: 140420 17:11:03 [Note] Plugin 'FEEDBACK' is disabled.
mysqld_safe[29684]: 140420 17:11:03 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
mysqld_safe[29684]: ERROR: 1146  Table 'mysql.user' doesn't exist
mysqld_safe[29684]: 140420 17:11:03 [ERROR] Aborting
mysqld_safe[29684]:
mysqld_safe[29684]: 140420 17:11:03 [Note] /usr/sbin/mysqld: Shutdown complete

Note: I've removed the date/time and my hostname from the beginning of each log line.

I then created a swap file (256MB was enough) and ran:

sudo aptitude install -f

Which finished the install.

I don't know if every instance of this error could be fixed in the same way, but given EAPubs' answer involved rebooting the server, I wonder if that was the real fix: freeing up memory by rebooting.

  • I had the same error and log entries, however, I was able to get around them by doing a good old-fashioned reboot instead of creating swap. – Paul Nov 12 '15 at 4:51
  • @Paul in that case, I imagine that after rebooting you had enough free memory for the install to go ahead without the need for swap. – Ellis Nov 13 '15 at 21:10
  • Yes, I just wanted to let others who find this solution to be aware that they may be able to get away with a simpler one. (I have to admit that I forget about such simple things sometimes.) – Paul Nov 13 '15 at 22:24
1

I've just solved this problem. The root of all that mess was in this message : "invoke-rc.d: initscript mysql, action "start" failed."

Here are the steps :

sudo apt-get purge mysql* mariadb*
sudo apt-get autoremove

Some install packages were "stuck" :

sudo rm /var/cache/apt/archives/mariadb*

These symbolic links were pointing to missing files

sudo rm /etc/systemd/system/mysqld.service
sudo rm /etc/systemd/system/mysql.service

Finally, this worked :

sudo apt-get install mariadb-server
0

While my current distro is 14.04, My fix should be relevant for similar issues.

I ran into this dependency/can't configure mariadb problem trying to clone my mysql/ onto a new install - didn't work.

My fix:

 - cd /var/lib
 - sudo service mysql stop
 - sudo cp -R mysql _mysql
 - sudo apt-get purge mysql* mariadb*
 - sudo rm -R mysql
 - sudo apt-get install mariadb-client mariadb-server
 - sudo cp -Ruv _mysql/. mysql/.
 - sudo mysql -u root -p ididityay! show databases
 - :D
 - sudo rm -R _mysql
0

I posted my answer here but here it is again because I wasted a couple of hours to find a solution (it is obvious now but...).

You need to specify version for mysql (dependencies) packets.

apt-get install mariadb-server mysql-common=10.1.19+maria-1~trusty libmysqlclient18=10.1.19+maria-1~trusty

You can get versions with

apt-cache policy mysql-common

You can always rollback with

apt-get remove --purge mysql* mariadb*

If you don't have any data or special config do also

rm -R /etc/mysql
rm -R /varl/lib/mysql

Not the answer you're looking for? Browse other questions tagged or ask your own question.