Skip to main content

MY-SQL Command

Published 1 min readMarkdown
MY-SQL  Command

Commands used to host MySql Server on AWS EC2 Instance

Step 1: Update the system

sudo apt update

Step 2: Install MySql

sudo apt install mysql-server

Step 3: Check the Status of MySql (Active or Inactive)

sudo systemctl status mysql

Step 4: Login to MySql as a root

sudo mysql

Step 5: Update the password for the MySql Server

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'place-your-password-here';

FLUSH PRIVILEGES;

Step 6: Test the MySql server if it is working by running sample sql queries

step-1

CREATE DATABASE mysql_test;

step-2

USE mysql_test;

step-3

CREATE TABLE table1 (id INT, name VARCHAR(45));

step-4

INSERT INTO table1 VALUES(1, 'jiban'), (2, 'kushal'), (3, 'Bholi'), (4, 'Akash');

step-5

SELECT * FROM table1;

About the author

  • 👋 Hello! I'm Jiban Kumer about DevOps and have over 1.5+ years of experience in the field. I'm proficient in a variety of cutting-edge technologies and always motivated to expand my knowledge and skills. Let's connect and grow together!

    SKILLS:

    🔹 Languages & Runtimes: Python, Shell Scripting, HCL, YAML 🔹 Cloud Technologies: AWS, GCP 🔹 Infrastructure Tools: Docker, Terraform, AWS CloudFormation 🔹 Other Tools: Linux, Git and GitHub Actions, Jenkins, Jira, GitLab (beginner), Docker, AWS DevOps

No comments yet. Be the first to comment.

More from this blog