mirror of
https://github.com/Lemonochrme/service-architecture.git
synced 2025-06-08 13:40:50 +02:00
Update README.md
This commit is contained in:
parent
db53c2169d
commit
700abc480f
1 changed files with 55 additions and 1 deletions
54
db/README.md
54
db/README.md
|
@ -25,3 +25,57 @@ FLUSH PRIVILEGES;
|
||||||
### Run the `init.sh` to create the database.
|
### Run the `init.sh` to create the database.
|
||||||
|
|
||||||
> If you want to update the database, it is recommended to run `remove.sh` before hand.
|
> 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 '<user>'@'localhost' IDENTIFIED BY '<password>';
|
||||||
|
GRANT ALL PRIVILEGES ON *.* TO '<user>'@'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
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue