MY-SQL Client-Server Architecture

DEPLOYMENT OF A FULLY FUNCTIONAL MY-SQL CLIENT/SERVER ARCHITECTURE

Client-Server Architecture

Client-server architecture involves the connecting together of one or more computers through a network to send and receive requests between one another.This type of architecture involves each machine taking up the role of a CLIENT who continually sends a request and the other machine receives and responds to the request sent which is known as a SERVER.

In this project, we would be working with the following:

A webserver that serves a client role connects and communicates back and forth with a database server which in turn receives and responds to the webserver.

The pre-requisite for the project is the following.

  1. Fundamental Knowledge of Installing and downloading software

  2. Basic Understanding of Linux Commands

  3. AWS account login with EC2 instance

  4. Internet connection

Implementation Steps:

  1. Ensure you login with your details to your AWS console via the https://aws.amazon.com

  2. Click on the EC2 link to create 2 instances namely MySQL server and MySQL client.

image1

The 2 instances successfully launched and click to view Instance details with the IP address. Please note by default both instances were created in the same local virtual network, hence they would communicate on the same IP address.

image2

Click the “Connect” button and copy the ssh client details we would be using on the git bash console.

image3

Click on security button and then proceed to click the security group link.

image4

image5

Proceed to edit the inbound rules to add and save rules. Ensure you allocate port 3306 on MYSQL server with the IP address shown below. Always make sure the Ip address is only accessible by the MySQL client-server

image6

image7

image8

Rules added.

image9

Open git bash on Visual Studio code or whichever console is convenient to use. We are using git bash here with Visual Studio Code. Type YES to connect.

image10

Proceed to update the lists of packages in the package manager.

image11

Then we proceed to install MySQL server

image12

We enable the MySQL server and then proceed to secure the server using a blank password.

image13

After this, we connect back to our MySQL database server to create a database,grant all permission for the user created and finally flush privileges and quit the MySQL

image14

We would need to configure the MySQL server to allow connection to remote host as shown below by editing the .cnf file and changing the bind address to 0.0.0.0 as seen below

image15

image16

CONFIGURATION OF MYSQL – CLIENT

Then we go back to AWS to connect the MYSQL -client-server

Click the “Connect” button and copy the ssh client details we would be using on the git bash console.

image17

Click on the security button and then proceed to click the security group link.

image18

image19

Proceed to editing the inbound rules to add and save rules. Ensure you allocate port 3306 on MYSQL server with the IP address shown below. Always make sure the IP address is only accessible by the MySQL client-server

image20

image21

image22

image23

Rules added

image24

Open git bash on Visual Studio code or whichever console is convenient to use. We are using git bash here with Visual Studio Code. Type YES to connect.

image25

Proceed to update the lists of packages in the package manager.

image26

Then we proceed to install MySQL client and confirm the initial IP address on the server

image27

image28

We then connect with the command below to the remote database server.

image29

Then we confirm by showing the databases as shown below.

image30

This shows that we have successfully deployed a fully functional My-SQL Client-Server set-up.

If this post was helpful, Would be great if you could click the clap button 👏below to show your support.

Thank you for reading💚👏 👏👏