I've tried to follow the official guidance on installing MySQL on a fresh Debian install.

So I went to https://dev.mysql.com/downloads/repo/apt/, downloaded mysql-apt-config_0.8.13-1_all.deb,

Run through the installer options with

sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb

...which seems to work (albeit with a warning):

(Reading database ... 32947 files and directories currently installed.)
Preparing to unpack mysql-apt-config_0.8.13-1_all.deb …
Unpacking mysql-apt-config (0.8.13-1) over (0.8.13-1) …
Setting up mysql-apt-config (0.8.13-1) …
Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config)

I do my

sudo apt update

Which again, seems to give sensible output:

Get:1 http://security.debian.org/debian-security buster/updates InRelease [39.1 kB]
Hit:2 http://deb.debian.org/debian buster InRelease
Get:3 http://deb.debian.org/debian buster-updates InRelease [49.3 kB]
Hit:4 http://repo.mysql.com/apt/debian buster InRelease
Hit:5 https://packages.microsoft.com/debian/10/prod buster InRelease
Fetched 88.4 kB in 1s (85.1 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

Things start to go wrong when I get to step 2, as running

sudo apt-get install mysql-server

Fails with output:

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

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

So what am I doing wrong that is stopping this from working?

I've checked /etc/apt/sources.list.d/mysql.list, and that looks sensible:

# You may comment out entries below, but any other modifications may be lost.
# Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications.
deb http://repo.mysql.com/apt/debian/ buster mysql-apt-config
deb http://repo.mysql.com/apt/debian/ buster mysql-8.0
deb http://repo.mysql.com/apt/debian/ buster mysql-tools
#deb http://repo.mysql.com/apt/debian/ buster mysql-tools-preview
deb-src http://repo.mysql.com/apt/debian/ buster mysql-8.0

The output from apt-cache policy mysql-server is

  Installed: (none)
  Candidate: (none)
  Version table:
  • 1
    Please can you add the output of cat /etc/apt/sources.list.d/mysql.list or the appropriate equivalent. (I'm interested in the deb configuration, so grep -r mysql /etc/apt/sources* would work, too.) – roaima Aug 20 '19 at 20:22
  • @roaima it looks sane to me, but have added to the question :) – Rowland Shaw Aug 21 '19 at 19:27
  • 1
    @Jona that looks a little odd to me, as I'd expect something to be showing as a candidate and something in the version table :/ – Rowland Shaw Aug 21 '19 at 20:01
  • 1
    Sorry, I meant dpkg --print-architecture ? – Jona Aug 21 '19 at 20:29
  • 1
    See, that gives i386, which you'd think would count as supported – Rowland Shaw Aug 21 '19 at 20:34

To install the Debian provided packages, remove the repository that was installed from dev.mysql.com, and then this command should work:

apt install mariadb-server mariadb-client

MariaDB is the new name for the non-Oracle MySQL.

If you prefer to use the Oracle MySQL, then you just need to get the proper package name for the version you wish to install. Check the output of apt search mysql-server to see what is available (in their packaging, they seem to put the version as part of the name).


this worked for me on buster:

apt-get install default-mysql-server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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