Update the package index on your server
sudo apt update && sudo apt upgrade -y
Install MySQL Server
sudo apt install mysql-server
sudo mysql_secure_installation
When aks VALIDATE PASSWORD COMPONENT, just select N, then enter new root password. Remove Anonymous user and test database, Disallow root login remotely = N
After running mysql_secure_installation
, open mysql command prompt, using sudo mysql
, then run the following query:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';