Skip to content

ahujashivani/MySQL-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

MySQL Server README

Table of Contents
    • About The Project
  1. Getting Started
    • Prerequisites
    • Docker-ENVs
    • Installation
  2. Usage
  3. Contact
  4. Acknowledgements

About The Project

We created this project to

Product Name Screen Shot

Getting Started

In order to obtain a local copy of this project, please follow these simple steps:

  1. Clone the following repo: https://github.com/ahujashivani/MySQL-Server.git
  2. Install Docker (Desktop Application)
  3. Complete the following terminal commands listed in the "installation" section

Prerequisites

Please make sure to have Docker downloaded as a Desktop application and have the recently cloned directory opened in terminal. Port 8080 and 8000 should remain open until the server starts running.

Docker-ENVs

The following Environment variables have already been added to the Docker-Compose file. These are placed here for your reference. If you are altering the database name, please make sure to alter the DB_DATABASE environment variable.

DB_USER: "root"
DB_PASSWORD: "rootpassword"
DB_HOST: "mysql_db_container:3306"
DB_DATABASE: "Dummy_data"
DB_PORT: "8000"
MYSQL_CONNECTION: "root:rootpassword@tcp(127.0.0.1:3306)/Dummy_data"

Installation

The following terminal commands will allow you to run a local version of the server.

docker build --tag docker-gs-ping .
docker-compose up

After the Docker container is running, Port 8080 should spin a MySQL server with Docker and Docker Compose (with Adminer). Port 8000 (http://localhost:8000/test) should render a neat User Interface. Port 8080 should now have the following login page:

Screen Shot 2021-08-04 at 2 57 24 PM

The username and password will be filled out, so clicking "login" will render a page with a list of databases. Instead of choosing an existing database, click "create database" on the top left page. Title the database "Dummy_data" The specific database in the main.go is referenced as "Dummy_data". The specific table in the "Dummy_data" database that is referenced throughout the code is titled "authors". Below, we have provided a screenshot of the table:

Screen Shot 2021-08-04 at 2 44 54 PM

The previous instructions should have provided you with information in regards to the creation of the database and table. The usage examples will further explain how the server can be utilized.

Usage

In this section, please have the test.yml file open in an Integrated Development Environment. The YML file is where the database queries are located. It should be noted that each query can be found at http://localhost:8000/ after appending the query variable name to the slash. Examples are provided below.

A screenshot of this file is provided below:

Screen Shot 2021-08-04 at 3 09 55 PM

The application can take multiple queries at once.

EXAMPLE:

Head to http://localhost:8000/test. This refers to the first "test" query. The database should render as a neat UI and look like the following:

Screen Shot 2021-08-04 at 3 13 49 PM

EXAMPLE 2:

Head to http://localhost:8000/test2. This refers to the "test2" query. The database should reder as a neat UI and look like the following:

Screen Shot 2021-08-04 at 3 14 32 PM

The SQL queries in the YML file will be parsed in main.go and render on http://localhost:8000/

Contact

Shivani Ahuja - shivaniahuja2001@gmail.com
Nick Almeder - [add email here]

Project Link: https://github.com/ahujashivani/MySQL-Server

Acknowledgements

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published