-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
31 lines (23 loc) · 968 Bytes
/
database.sql
File metadata and controls
31 lines (23 loc) · 968 Bytes
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
31
-- pour créer une table
CREATE TABLE UserList (
id SERIAL PRIMARY KEY,
username VARCHAR(50) NOT NULL,
email VARCHAR(50) NOT NULL,
password VARCHAR(50) NOT NULL,
hp INT NOT NULL,
posx FLOAT NOT NULL,
posy FLOAT NOT NULL,
posz FLOAT NOT NULL
);
-- pour voir toutes les tables existantes
-- SHOW FULL TABLES;
-- pour voir ce qu'il y a dans une table
-- SELECT * FROM UserList;
-- pour utiliser la bonne database
-- use server-database;
-- pour inserer une nouvelle row dans une table
-- INSERT INTO UserList (username, email, password, hp, posx, posy, posz) VALUES ('Geocraft', 'ulysserousselet2004@gmail.com', 'Geocraft', 100, 0.0, 0.0, 0.0);
-- sudo apt-get install libmysqlcppconn-dev
-- https://mariadb.com/resources/blog/how-to-connect-c-programs-to-mariadb/
-- https://dev.mysql.com/doc/connector-cpp/1.1/en/connector-cpp-examples-query.html
-- GRANT ALL PRIVILEGES ON *.* TO ulysse@localhost IDENTIFIED BY 'Geocraft10';