My mysql got replaced with MariaDB

February 1, 2018 759 views
MySQL Ubuntu 16.04

Hello, my mysql got replaced with mariadb, trying to install mysql-server gives me that:

root@BananasOnFire:~# sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  mariadb-server-10.2:i386 mariadb-server-10.2

E: Package 'mysql-server' has no installation candidate
root@BananasOnFire:~#

going to: bananasonfire.tk/phpmyadmin says:

Not Found
The requested URL /phpmyadmin was not found on this server.

Apache/2.4.18 (Ubuntu) Server at bananasonfire.tk Port 80

I lost all my databases :(

1 comment
1 Answer

May i know which distro/version is running?

Try to search for the package using apt-cache and install.

$sudo apt-cache search mysql | grep mysql-server

  • version: Ubuntu 16.04 x64

    $ sudo apt-cache search mysql | grep mysql-server

    gives me that:

    root@BananasOnFire:~# sudo apt-cache search mysql | grep mysql-server
    mysql-server - MySQL database server (metapackage depending on the latest version)
    mysql-server-5.7 - MySQL database server binaries and system database setup
    mysql-server-core-5.7 - MySQL database server binaries
    mysql-server-5.6 - MySQL database server binaries and system database setup
    mysql-server-core-5.6 - MySQL database server binaries
    root@BananasOnFire:~#
    
    
    • Please try this...

      $sudo apt-get install mysql-server-5.7

      • it gives me:

        root@BananasOnFire:~# sudo apt-get install mysql-server-5.7
        Reading package lists... Done
        Building dependency tree
        Reading state information... Done
        mysql-server-5.7 is already the newest version (5.7.21-0ubuntu0.16.04.1).
        The following packages were automatically installed and are no longer required:
          libdbd-mysql-perl libdbi-perl libmysqlclient20 libterm-readkey-perl mysql-common-5.6
        Use 'sudo apt autoremove' to remove them.
        0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
        2 not fully installed or removed.
        After this operation, 0 B of additional disk space will be used.
        Do you want to continue? [Y/n] y
        Setting up mysql-server-5.7 (5.7.21-0ubuntu0.16.04.1) ...
        /var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory
        dpkg: error processing package mysql-server-5.7 (--configure):
         subprocess installed post-installation script returned error exit status 1
        dpkg: dependency problems prevent configuration of mysql-server:
         mysql-server depends on mysql-server-5.7; however:
          Package mysql-server-5.7 is not configured yet.
        
        dpkg: error processing package mysql-server (--configure):
         dependency problems - leaving unconfigured
        No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                                  Errors were encountered while processing:
         mysql-server-5.7
         mysql-server
        E: Sub-process /usr/bin/dpkg returned an error code (1)
        root@BananasOnFire:~#
        
        
        • 1. Purge the mysql:

          $sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server

          2. Clean up & update:

          $sudo apt-get clean && sudo apt-get update && sudo apt-get autoremove && sudo apt-get -f install

          3. Install Mysql:

          $sudo apt-get install mysql-server-5.7

Have another answer? Share your knowledge.