Skip to content

Instantly share code, notes, and snippets.

@Mgregchi
Created April 28, 2023 11:04
Show Gist options
  • Save Mgregchi/2a260efa96cfa7885a40e6c7a5d3af11 to your computer and use it in GitHub Desktop.
Save Mgregchi/2a260efa96cfa7885a40e6c7a5d3af11 to your computer and use it in GitHub Desktop.
How to install MySQL 5.7* on ubuntu

[How to] Install mysql 5.7

Copy the key here to your clipboard

Save it in a file on your machine i.e. signature.key and then

sudo apt-key add signature.key

add the apt repo

sudo sh -c 'echo "deb http://repo.mysql.com/apt/ubuntu bionic mysql-5.7" >> /etc/apt/sources.list.d/mysql.list'
update apt

sudo apt-get update

now check your available versions:

ubuntu@root:/mgregchi$ sudo apt-cache policy mysql-server
mysql-server:
  Installed: (none)
  Candidate: 8.0.27-0ubuntu0.20.04.1
  Version table:
     8.0.27-0ubuntu0.20.04.1 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
     8.0.19-0ubuntu5 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
     5.7.37-1ubuntu18.04 500
        500 http://repo.mysql.com/apt/ubuntu bionic/mysql-5.7 amd64 Packages

Now install mysql 5.7

sudo apt install -f mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7*

Check version

mysql --version

Confirm sql is working

sql
sql>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment