EX- 7 (A) INSTALLING MYSQL IN AWS

                            INSTALLING MYSQL IN AWS


STEP 1: First we have launch a EC2 Instance in AWS 





fill the details required for launching an EC2 instance 




Edit the  Network settings and add security group rule, choose type info as "MYSQL/Aurora" and source type as "Anywhere" and give launch instance.




Choose your instance and click connect 



In EC2 Instance Connect choose connect 


Instance has successfully connected 




STEP 2 : Enter the command to install mysql server in AWS 

“sudo yum update -y” basically updates all packages to their latest version from a repository list which is managed by Amazon for Amazon Linux 2.

for installing mysql type the command
 
#install mysql server 
sudo yum install -y mariadb-server


#start the mysql server 
sudo systemctl start mariadb 

#enable mysql to start when system reboots 
sudo systemctl enable mariadb 



Next, we need to secure the installation by running this command.


sudo mysql_secure_installation


And set root password 





After that, you can connect to your MySQL server by running this command.

mysql -uroot -p;

if you run this command then it will ask you for the password. Please provide the new password which you set in the MySQL secure installation process. If you have done all the steps correctly then you will probably see this message ” Welcome to the MariaDB monitor”


> Execute the command to Create database in mysql server 

create database demo;


> Now execute the command to go to demo database

use demo;

> Execute the command to create database user

CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin'; 


> Execute the command to grant all privileges 

GRANT ALL PRIVILEGES ON demo.* TO 'admin'@'localhost';

> Execute the command to FLUSH privileges:

FLUSH PRIVILEGES;

> To come out of database execute the command 

quit







Comments