24

I used to install mysql 5.6 in this way.. But now..

# echo "deb http://repo.mysql.com/apt/debian/ $(lsb_release -sc) mysql-5.6" >> /etc/apt/sources.list && echo "deb-src http://repo.mysql.com/apt/debian/ $(lsb_release -sc) mysql-5.6" >> /etc/apt/sources.list && apt-get update

# apt-get install mysql-server-5.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package mysql-server-5.6 is a virtual package provided by:
  mysql-community-server 5.6.29-1debian8 [Not candidate version]

E: Package 'mysql-server-5.6' has no installation candidate

I need to reinstall mysql 5.6. Have tried this

# apt-get install --reinstall mysql-community-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reinstallation of mysql-community-server is not possible, it cannot be downloaded.

Originally it was installed with

apt-get install mysql-server-5.6
clarkk
  • 1,727
  • 6
  • 31
  • 43
  • 1
    You provided no information about your distribution or release, it's obviously apt based, but beyond that there's no way to answer your question until you provide the full distro info. – Lizardx Sep 12 '17 at 23:27
  • All the info you need to install mysql 5.6 on Debian is here: https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/ – Wombat Mar 19 '16 at 10:32

5 Answers5

23

sudo apt install mariadb-server

Tamil
  • 487
  • 1
  • 4
  • 10
  • 9
    ... because? mariadb replaced mysql (at some point?) Note that this question was posed in 2016... – Jeff Schaller Sep 23 '19 at 13:35
  • 1
    Today I am facing this issue in Debian 10. – Tamil Sep 23 '19 at 15:30
  • Then it might be more appropriate to find a more recent question; note that this question centers around Debian 8. – Jeff Schaller Sep 23 '19 at 15:36
  • 1
    After a little searching, it [appears](https://packages.debian.org/jessie/database/mariadb-server) that mariadb-server was an available package for Debian 8 (Jessie). This answer could still be improved with an explanation for the OP, rather than being a single-line "code dump". – Jeff Schaller Sep 23 '19 at 15:42
  • 1
    This answer needs more clarification, even if it works. – JohnnyApplesauce Aug 03 '20 at 23:57
16

If you navigate the http://repo.mysql.com/apt/debian/pool/ repo, you'll find various versions available.

It looks like mysql-server-5.6 was a metapackage, which is not there any longer.

However, to discover the actual package name for installation, just do:

apt-cache search mysql-server

and the actual package name for installation should appear.

Lizardx
  • 2,990
  • 16
  • 18
3

Try to configure MySQL PPA before install (You need to choose SQL version e.g. 5.7)

wget http://repo.mysql.com/mysql-apt-config_0.8.13-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb

Now, update and install it

sudo apt update 
sudo apt install mysql-server

Source: tecadmin

Tur Le
  • 81
  • 1
  • 1
1

I have had the problem of fetching mysql-5.6 for my developers' workstations (which run a more recent distro that no longer has the version I need). After much fighting and failing with source files I went hunting for the *.deb files, installed them manually and then marked them for holding.

I found the packages I wanted in http://repo.mysql.com/apt/ubuntu/pool/mysql-5.6/m/mysql-community/, but there are debian versions as well.

Download your required version of (you don't need all but I like to have them)

  • libmysqlclient18
  • mysql-common
  • mysql-community-client (depends on common)
  • mysql-community-server (depends on client)
  • mysql-client
  • mysql-server

Install them manually using sudo dpkg -i <deb-file>. There has to be a better way of doing this, dpkg does not resolve dependencies automatically.

When you hit a dependency quandary, run sudo apt-get -f install and cross your fingers that it'll resolve the marked dependencies (I can't help any further but to say hunt down the package and install it manually also).

Retry installing the failed package installations.

Lastly, hold your versions with sudo apt-mark hold <package-name> ... In my case it was easy:

sudo apt-mark hold mysql-{common,community-{client,server}}

This process has been performed in a virtualized test environment and it has worked so far

hanzo2001
  • 185
  • 1
  • 6
0

After you've added the repo, search it using the madison option for apt-cache - ie, apt-cache madison mysql-server - it will tell you what versions are available from what repos (from your sources.list* stuff)

ivanivan
  • 4,870
  • 1
  • 9
  • 20