Skip to content
Filip Krzyżanowski edited this page Nov 12, 2022 · 1 revision

Installation

1. Update and upgrade apt package manager

sudo apt update && sudo apt upgrade -y

2. Install required packages

sudo apt install gnupg wget -y

3. Download MySQL .deb package

You can download another version of MySQL form here

# Example link, you put your link after wget
wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb

4. Add downloaded .deb package to package manager

Run your dpkg package with the -i flag, that indicates that you’d like to install from the specified file and * char depends all files that's name start from mysql-apt-config

sudo dpkg -i mysql-apt-config*

When you see screen with MySQL and MySQL tools select menu, select mysql-8 and press ENTER, press TAB and ENTER.

5. Update apt package manager

sudo apt update

6. Install MySQL server

sudo apt install mysql-server -y

During installation, you must set root account password and select authentication plugin. I recommend Strong password encryption

7. Check installation

sudo mysql --version

Configuration

1. Run secure installation and configure MySQL

sudo mysql_secure_installation

During installation, you need to configure the password validation level, choose whether you want to change the root password (if set), delete anonymous users or not, prohibit remote root login, delete the test database and reload the permissions.
I recommend: 2, No (if set), Yes, Yes, Yes, Yes