How to install MySQL on Ubuntu 22.04 LTS

In this article, we will see how to install MySQL on Ubuntu 22.04 LTS step by step.

How to install MySQL on Ubuntu 22.04

1. Open terminal, then run the below command to update packages.

sudo apt-get update

How to install MySQL on Ubuntu 22.04 LTS

2. Now, install mysql server using the below command:

sudo apt-get install mysql-server

3. Type ‘Y’ and hit enter.

4. After installation is complete, then verify by running below command.

sudo systemctl status mysql

Post MYSQL installation steps on Linux

1. Connect to the mysql servewr using sudo mysql

2. Now change password of user root.

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'PassWord@123';

Then run flush privileges;

3. Now run the secure installation application.

4. Now, enable to auto-start the MySQL service whenever Linux machine is restarted.

sudo systemctl enable mysql

The same process explained in the below video.