Install MYSQL on Linux Ubuntu Server

sudo apt install mysql-server -y
sudo systemctl status MySQL
mysql --version

sudo MySQL
SELECT user, host, plugin FROM mysql.user WHERE user = 'root';

ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'YOUR_PASSWORD';
CREATE USER IF NOT EXISTS 'root'@'%' IDENTIFIED WITH caching_sha2_password BY 'YOUR_PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

SELECT user, host, plugin FROM mysql.user WHERE user = 'root';
EXIT;

sudo ss -lntp | grep 3306
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 0.0.0.0
sudo systemctl restart MySQL

sudo ufw status (should be off/inactive)

You cannot comment on this entry