When you are going to install MySql in your ubuntu (Linux machine)
First Step:
run command sudo apt install mysql-server
this command will install mysql-server your machine. After successful installation. Type
sudo mysql -u root
This will allow to login into mysql without entering password. now set the password for root user.
Now set password for user ‘root’
alter user root@localhost identified by ‘Pass@123’;
this will set the password for user root@localhost.
now you can sign out by typing exit. and again login with root user and password.
sudo mysql -u root -p
You can run any command like show databases;
Login to discuss.