Skip to main content
GrN.dk

Main navigation

  • Articles
  • Contact
  • Your Digital Project Manager
  • About Greg Nowak
  • Services
  • Portfolio
  • Container
    • Excel Freelancer
    • Kubuntu - tips and tricks
    • Linux Apache MySQL and PHP
    • News
    • Image Gallery
User account menu
  • Log in

Breadcrumb

  1. Home

Install a Specific Version of MySQL Server on Ubuntu

The original version of this page was a single command: sudo apt-get install mysql-server-5.6. That matched an older Ubuntu era, but it is not the right default on a current Debian or Ubuntu host. As of May 31, 2026, Oracle's MySQL APT repository publishes current release tracks such as 9.7 LTS, 8.4 LTS, Innovation, 8.0, and 5.7. In other words, the modern job is usually not "find an old package name" but "pick the right supported MySQL series, then install it cleanly."

If you are running a client site, internal platform, or agency-managed server, that distinction matters. The database version affects vendor support, upgrade cost, compatibility with your application stack, and how much operational debt you create for the next team touching the box. If someone tells you "we need MySQL 5.6," verify whether that is a real software requirement or just an outdated note copied from a legacy runbook.

What "specific version" should mean in 2026

For most production installs, choosing a specific version means choosing the right release series first. Oracle now separates MySQL into LTS and Innovation tracks. For a business system that needs predictable maintenance and fewer surprises, an LTS release is usually the sensible default. In practice, that often means starting with 8.4 LTS unless your software vendor, hosting standard, or compatibility testing says otherwise.

A useful decision filter is simple:

  • Choose 8.4 LTS for most new production systems.
  • Choose 8.0 or 5.7 only if an application or vendor contract specifically requires it.
  • Choose the Innovation track only if your team has the testing discipline and release cadence to absorb faster change.

This is the part older installation snippets miss. You are not only installing a package. You are choosing an upgrade path and a support posture for the system.

Recommended install path on Ubuntu or Debian

On a current host, the clean approach is to use Oracle's MySQL APT repository, select the release series you want, update package metadata, and then install MySQL. The official flow is straightforward:

sudo dpkg -i /PATH/version-specific-package-name.deb
sudo apt-get update
sudo apt-get install mysql-server
systemctl status mysql

The first step installs Oracle's mysql-apt-config repository package. During that setup, you choose the MySQL series you want to receive, such as 8.4 LTS or 8.0. After that, sudo apt-get install mysql-server installs the server for the selected series. If you left the root password blank during install, you can harden the instance afterward with mysql_secure_installation.

If you later need to switch between supported major series, reconfigure the repository first and refresh the package list:

sudo dpkg-reconfigure mysql-apt-config
sudo apt-get update

That is the operationally important detail: the repository configuration determines which major MySQL series APT will install or upgrade. The mysql-server package then follows that choice.

There is one important caveat for ops teams. Once the MySQL APT repository is enabled, you are no longer relying on Ubuntu's native MySQL packages. That is fine when deliberate, but it should be treated as a packaging decision, not a casual tweak. Back up first, document the change, and do not assume MariaDB or Percona can be swapped in place through the same path.

If you need an exact package build

Sometimes "specific version" really does mean an exact build, for example to match staging, reproduce a vendor-certified stack, or keep a client server aligned with a known-good release. APT still supports that workflow, but you should inspect the available versions before installing anything.

apt-cache policy mysql-community-server
apt-cache madison mysql-community-server
sudo apt-get install mysql-community-server=<version>

Debian's APT tooling supports the package=version syntax directly. Use it carefully. Exact-version installs can pull matching dependencies, block future upgrades, or trigger downgrades if the rest of the MySQL package set is out of sync. On production client systems, that means exact pinning should be deliberate, tested, and documented rather than done ad hoc during an outage.

If APT requires matching client or core packages, install those at the same version in the same change window. The goal is consistency across the MySQL package set, not just a green checkmark on one package name.

When an old requirement is really a migration project

MySQL 5.6 is not part of the current MySQL APT repository lineup. So if your brief still says mysql-server-5.6, the right response is usually not to hunt for a random mirror or revive an unmaintained tutorial. The safer interpretation is that you are dealing with a legacy dependency that needs one of three responses: verify whether the application supports a newer series, isolate the old stack in a short-term legacy environment, or plan a staged migration.

That matters commercially as well as technically. A forced legacy database version can affect hosting options, security reviews, client support commitments, and the amount of future engineering time tied up in maintenance. If you are inheriting an old workload, treat the database version as part of project discovery, not as a small line item for deployment.

Oracle's own upgrade guidance is also conservative: move through supported series instead of skipping blindly, and treat upgrades as real change work with backups, compatibility checks, and rollback planning. That is especially important when old application code, plugins, or ORM assumptions are in play.

Bottom line

On a modern Ubuntu or Debian system, installing a specific version of MySQL is mainly about selecting the right MySQL release series in Oracle's APT repository and then installing the server package cleanly. Exact build pinning is possible when you truly need it. But if someone is still asking for MySQL 5.6 on May 31, 2026, you are probably looking at a legacy containment or migration decision rather than a normal install task.

If you need help choosing the right MySQL version, cleaning up a legacy install path, or planning a lower-risk upgrade for a client environment, Greg can help scope the work before it turns into a production fire drill.

Need help with this kind of work?

Need a MySQL version-selection, migration, or upgrade plan for a live environment? Greg can help scope and run it. Get in touch with Greg.

Sources

  • MySQL APT Repository
  • A Quick Guide to Using the MySQL APT Repository
  • MySQL Releases: Innovation and LTS
  • apt-get(8) Debian Manpages
  • apt-cache(8) Debian Manpages
Last modified
2026-05-31

Tags

  • mysql
  • Ubuntu
  • DevOps
  • Server Administration
  • Log in to post comments

Review Greg on Google

Greg Nowak Google Reviews

 

  • Mysqldump Encoding: How to Avoid Broken Characters in Exports
  • Install a Specific Version of MySQL Server on Ubuntu
  • Fixing the HTTPRL Core Drupal Network Configuration Error in Drupal 7
  • OpenAI's Responses API shift turns old internal assistants into a paid migration project
  • Sending Mail with Drupal: Reliable Setup for Modern Sites
RSS feed

GrN.dk web platforms, web optimization, data analysis, data handling and logistics.