Install and Setup

Chester Wyke September 21, 2022 Updated: April 15, 2025 #sql

Tested OS

This setup was done and tested on Ubuntu 22.04

Source: https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-22-04

Install MariaDB

sudo apt install mariadb-server

Start

sudo systemctl start mysql.service

Configure

As of July 2022 mysql_secure_installation will produce an error due how it attempts connection. This error results in a loop.

Open SQL command prompt

See instructions here.

Set root password

Replace p@s$w0rD by a suitable strong password.

ALTER USER 'root'@'localhost' IDENTIFIED BY 'p@s$w0rD';

Close SQL command prompt

exit

You will no longer be able to access mysql using sudo mysql

Run command to secure installation

Now secure the setup. Run the command and follow the steps as appropriate.

sudo mysql_secure_installation