Skip to content

teejay4u/Project-5-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project-5-MySQL Client-Server Architecture Project

This Project involed setting up a MySQL-server and MySQL-client and configuring them to connect to each other remotely.

1. The first step was to set up two virtual machines using AWS, one for the db-server and one for the db-client.

2. Then I connected to both instances using SSH on port 22 on the security group of both instances

    ssh -i "privatekey.pem" ubuntu@ec2<pub-ip>.compute-1.amazonaws.com

3. I installed mysql-server on the db-server by running the following commands;

    # For Server
    sudo apt update 
    sudo apt upgrade -y
    sudo apt install mysql-server 

    # For Client
    sudo apt update 
    sudo apt upgrade -y
    sudo apt install mysql-client

4. To show if service is running

    Sudo systemctl status mysql

5. Then i ran the security script to ensure my database is secure

     ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Password.1';

     sudo mysql_secure_installation

6. Then i logged in to the database by running

    sudo mysql -p 

7. Then i created a database user for the client using the command

    CREATE USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'Password.1';

8. Next i created a databases with the command

    CREATE DATABASE cybrox_db;

9. Granting permissions to the created user

    GRANT ALL ON cybrox_db.* TO '<username>'@'%' WITH GRANT OPTION;

10. Effecting Priviledges

    FLUSH PRIVILEGES;

11. Editing Configuration files

    sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf

12. Restarting mysql service so changes can be effected

    sudo systemctl restart mysql 

13. Checking ip address of mysql-client

    ip addr show 

14. Next i opened port 3306 in db-server security group and added private ip of mysql-server to its inbound rules

15. connecting to db-server from client using the code

    sudo mysql -u teejay -h <private ip of dbserver> -p

16. Creating the Virtual Machines on AWS Console

17. mysql service running on server

18. Securing DB-server

19. Creating Db-user on server

20. Granting Permissions to DB-user

21. Setting Bind address to accept all ip address from client user

22. Connected to DB-server from mysql-Client

23. Showing available databases on db-server from mysql-client

Releases

No releases published

Packages

No packages published