File size: 1,534 Bytes
ff6d992
9182aa9
bb2257c
c1f6209
bc87a74
a710ada
bc87a74
 
 
 
 
 
 
c1f6209
 
bc87a74
 
 
 
 
c1f6209
 
a710ada
bc87a74
10fcc9b
910d380
10fcc9b
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

SELECT VERSION();
-- Étape 1 : Création de la table User avec les champs FirstName, LastName, Email, Authorization, username et password
USE rakuten_db;
CREATE TABLE Users (
    FirstName VARCHAR(30),
    LastName VARCHAR(30),
    Email VARCHAR(30),
    Authorization INT,
    username VARCHAR(30),
    password VARCHAR(128) -- 128 caractères pour stocker le hachage bcrypt
);

-- Étape 2 : Insertion d'un utilisateur pour tester
INSERT INTO Users (FirstName, LastName, Email, Authorization, username, password) VALUES ('Olivier', 'Renouard', 'olivier.renouard1103@gmail.com', 2, 'Olivier', '$2b$12$FWFmGn05f245f637.i9uYOdVEcDD2sC7ZO0cC0ePOjtY/OB6pOp0q');
INSERT INTO Users (FirstName, LastName, Email, Authorization, username, password) VALUES ('Fadimatou', 'Abdoulaye', 'afadimatou@gmail.com', 2, 'Fadimatou' , '$2b$12$66yNO9XAmZj2vMbYu.icRueNRVJK/cTWvoSE3czHt/P5BlKSFBdyu');
INSERT INTO Users (FirstName, LastName, Email, Authorization, username, password) VALUES ('John', 'Doe', 'john.doe@example.com', 1, 'John', '$2b$12$pfyjoh3RWS9crj8lFwF3ROWeSZ26Eu5m1WknmMJ0RqCYp.AHiu.MO');
INSERT INTO Users (FirstName, LastName, Email, Authorization, username, password) VALUES ('Alice', 'Sapritch', 'alice.sapritch@example.com', 0, 'Alice', '$2b$12$vxWf8VtgaKDrCJmSkY/XUuwm7Fkqqu6W6BLvtfpymVAoR4mq7xrKq');

-- Étape 3 : Sélectionner et afficher le contenu de la table
SELECT * FROM Users;

SELECT 
    @@hostname AS 'HOST_NAME',
    @@port AS 'PORT';