how to install mysql 5.6 in ubuntu 20.04 with cli code example

Example 1: how to install mysql in ubuntu 20.04

## To install mysql in Ubuntu ##
sudo apt install mysql-server

## For configuration 
sudo mysql_secure_installation

# For password type YES or y ... enter you password
# For removing user NO or n 
# For disallow login NO or n
# For remove database NO or n
# Reload table YES or y

## DONE configurations ...

## Start mysql with below command...
sudo mysql -u root -p 

# Enter password which you add in configurations
# Now you are all done...

Example 2: install mysql 5.7 ubuntu 20.04

sudo apt install -f mysql-client=5.7.32-1ubuntu18.04 mysql-community-server=5.7.32-1ubuntu18.04 mysql-server=5.7.32-1ubuntu18.04

Tags:

Sql Example