How to Install MySQL on Ubuntu 20.04

Hi Developers, In this post i’m going to explain all important steps to Download and install MySQL in Ubuntu operating system.After that i’ll display all databases available in MySQL and Query for creating database edit user privilege. Let’s see all important steps.

Step 1: Using “sudo apt-get update” command to update Ubuntu. Writing “sudo apt install MySQL-server”
command to download and install MySQL. There i’ll get message ,”Do you want to continue? [y/n]” write
y press enter to continue. For help see below image.

Step 2: Using “sudo MySQL_secure_installation” for performing secure installation of MySQL. See below image to achieve correct installation.

Step 3 : After Following all above image steps , MySQL install in Ubuntu correctly. you finally get message Success. All done.Now use “sudo mysql” command. now you can enter root directory of MySQL. now you can write any MySQL query. For Display database use “show databases” command. For creating database , write query “Create Database Sample”. For help see below image.

Step 4 : For all displaying user ,Authentication string, plugin , host write below query. see below query result root user “authentication_string” blank.Write Alter Query provide flush privilege to root user and select user ,Authentication string, plugin , host now you can see authentication_string of root user not blank.

Happy Programming…Thanks

Post Author: adama