From 700abc480f7a807da889683942b7466b5edcf219 Mon Sep 17 00:00:00 2001 From: Robin Marin--Muller <80280962+Lemonochrme@users.noreply.github.com> Date: Tue, 24 Dec 2024 11:37:20 +0100 Subject: [PATCH] Update README.md --- db/README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/db/README.md b/db/README.md index 99bb4d5..6e481e8 100644 --- a/db/README.md +++ b/db/README.md @@ -24,4 +24,58 @@ FLUSH PRIVILEGES; ### Run the `init.sh` to create the database. -> If you want to update the database, it is recommended to run `remove.sh` before hand. \ No newline at end of file +> If you want to update the database, it is recommended to run `remove.sh` before hand. + + +### Install MariaDB on Debian + +1. Update the package list: + ```bash + sudo apt update + ``` + +2. Install MariaDB: + ```bash + sudo apt install mariadb-server mariadb-client + ``` + +3. Secure the installation: + ```bash + sudo mysql_secure_installation + ``` + +4. Enable and start MariaDB: + ```bash + sudo systemctl enable mariadb + sudo systemctl start mariadb + ``` + +--- + +### Create a Database User + +1. Access MariaDB as root: + ```bash + sudo mariadb -u root -p + ``` + +2. Execute the following commands to create a new user: + ```sql + CREATE USER ''@'localhost' IDENTIFIED BY ''; + GRANT ALL PRIVILEGES ON *.* TO ''@'localhost' WITH GRANT OPTION; + FLUSH PRIVILEGES; + ``` + +--- + +### Initialize the Database + +- Run the `init.sh` script to set up the database: + ```bash + ./init.sh + ``` + +- To clean up before reinitializing, execute: + ```bash + ./remove.sh + ```