How to Install MYSQL Server On Amazon EC2 Instance

aws-mysql-logo

MySQL is one of the most popular open source relational database management system (RDBMS). MySQL has got its name from its co-founder Michael Widenius daughter “My” and “SQL” as Structured Query Language. It is most used in web based software applications. MySQL is also used by many high profile and large scale websites such as Google, Facebook, Twitter and YouTube.


Step 1.
Install mysql-server in your Machine by running bellow command from your terminal.

# apt-get install mysql-server -y

Step 2. Specify New password for Mysql root user.

Lamp mysql new password pic

Note: Confirm Password for Mysql root user.

Lamp mysql confirm password pic

Step 3. Log into your mysql server.

# mysql -u root -p

mysql login page

Step 4. Create New Database named Employee.

mysql> CREATE DATABASE  Employee;
mysql> use Employee;

Database creation page

Step 5. Create New table for Employee database.

mysql> create table Info (EmpId INT, First_Name VARCHAR(20),Last_Name VARCHAR(20),Address VARCHAR(20),City VARCHAR(15), Department VARCHAR(10),Salary INT);

Create table pic

Step 6. Insert Values in Info Table.

mysql> insert into Info values ( "1" , "Tom" , "Parker" , "WestStreet" , "Las Vegas" , "Accounts" , 1000 );

Values insert pic

Test mysql pic

Step 7. Create New User for Mysql named Harry.

mysql> CREATE USER 'Harry'@'localhost' IDENTIFIED BY 'Password';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'Harry'@'localhost';
mysql> FLUSH PRIVILEGES;

Create user pic

Note: Please Replace Above User and password  with your mysql User and Password.