MySQL Setup
Installation of My SQL
- run this Command in Linux Terminal to install MySQL
sudo apt install mysql-server
MySQL Root User Creation
-
After the installation of MySQL run this command to start MySQL
sudo mysql
-
To Create Root user for this use this Commmand (This command will be run in MySQL terminal )
alter user 'root'@'localhost' identified with mysql_native_password by 'root@123?'
Root User's PasswordNote Down RootUser Password. It will br the main Admin of MySQL. So It's Crucial
-
To get exit from MySQL Terminal type
exit
MySQL Secure Installation
-
To Secure the Installation of MySQL run following command. It will make MySQl Password Protected. It will ask to enter root password and will ask password strength.
mysql_secure_installation
Create Database
-
After the secure installation of MySQL you will not be able to login directly in MySQL using
sudo mysql
. -
To login in to Secured MySQL using password Use following command.
mysql -u root -p
-
The above command will ask for the password of the root user
-
To Create Database use the following command.
create database whoxa
-
To see all the Databases use Following command.
show schemas