Skip to content

timburr1/MySqlTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MySQL DAO


Simple Java project with Driver method and DAO.

Prerequisites

MySQL Setup

$ sudo apt install mysql-server
$ mysql -p

Creating a User

Once you have the MySQL CLI open enter the following line to create a new user:

CREATE USER 'sqluser'@'localhost' IDENTIFIED BY 'sqluserpw';

If you receive an error, try dropping the user in case it already exists:

DROP USER 'sqluser'@'localhost';

Creating a Database

CREATE DATABASE covid;
USE covid;

Granting Permissions

If you attempt to run this repository's Main.java file, you will likely receive an error stating that the 'sqluser' database user does not have permissions. Enter the following lines in the MySQL CLI:

GRANT USAGE ON *.* TO sqluser@localhost;
GRANT ALL PRIVILEGES ON covid.* TO sqluser@localhost;

Issues Configuring Java Workspace

  • Make sure you have the Java JDK installed.
  • If you are having issues running this repository in Visual Studio Code, follow the steps provided in this article.

TODO

Checkout the NYT's Covid dataset with:

git clone https://github.com/nytimes/covid-19-data.git

Modify the populateX() methods in MySqlDao to point to the appropriate csv files.
Query your new database tables with MySQL CLI or Workbench.
Ctrl+F "TODO" in MySqlDao.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •