Skip to content

timfox456/java-fsd-phase2

Repository files navigation

Java FSD Phase 2

Database

You will need to install MySQL or MariaDB.

One alternative to this if you lack admin permissions is XAMPP.

Creating a database and user

create database db_example; -- Creates the new database
create user 'springuser'@'%' identified by 'ThePassword'; -- Creates the user
grant all on db_example.* to 'springuser'@'%'; -- Gives all privileges to the new user on the newly created database

Creating a table

CREATE TABLE db_example.user (
  `id` int NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
);

Inserting some data

use db_example;
insert into db_example.user (id, email, name, password) values (1, 'someemail@someemailprovider.com', 'First', 'mypassword');
insert into db_example.user (id, email, name, password) values (2, 'someemail@someemailprovider.com', 'Second', 'mypassword2');

Testing a select

use db_example;
select * from user;

MYSQL Root Password Reset

Here's what to do if you run windows and have to reset your root password:

How to Reset Root Password

About

Phase 2 for Full Stack Developer Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages