1
==__ __==========_____=========================================================
4
| |\/| | / /\ \| | |_ |
6
|_|__|_/_/ \_\_____| _ _____ _ _
7
/ ____| | | | | | | __ \ | | | |
8
| (___ | |_ _ _ __| | ___ _ __ | |_ | |__) |__ _ __| |_ __ _| |
9
\___ \| __| | | |/ _` |/ _ \ '_ \| __| | ___/ _ \| '__| __/ _` | |
10
____) | |_| |_| | (_| | __/ | | | |_ | | | (_) | | | || (_| | |
11
|_____/ \__|\__,_|\__,_|\___|_| |_|\__| |_| \___/|_| \__\__,_|_|
12
================================================================================
13
Mahmood & Amir & Gustav Student Portal
14
================================================================================
19
INDEX --------------------------------------------------------------------------
23
* Initialising Database
26
General Information ------------------------------------------------------------
30
Setup --------------------------------------------------------------------------
34
Initialising Database ----------------------------------------------------------
36
Here follws a description of how to initialise the database in different
37
different database engines/managers/thingies.
39
The .sql files are located in ./src/main/resources/
41
Initialising Database: PostreSQL -----------------------------------------------
43
In postgres you need to start psql from the terminal:
44
$ psql -U <username> -a -f ./src/main/resources/create_db.sql
45
If the your database username is "postgres", you should use that. press enter
46
and enter the password fot the database user.
48
you should be something like this if it has been created correctly:
49
---------- snip ----------
50
Password for user postgres:
52
This should be used to create the database.
54
How to do this depends on the DB.
57
CREATE DATABASE mag_studentportal
59
CONNECTION LIMIT = -1;
61
---------- end snip ----------
63
Now that you have created the database you need to initialise the tables, to
64
do this you need to run the following:
65
$ psql -U <username> -d mag_studentportal \
66
-a -f ./src/main/resources/create_tables.sql
67
That sould run without any errors.
69
Congratulations! The database is now initialised!
72
Initialising Database: MariaDB/MySql -------------------------------------------
b'\\ No newline at end of file'