mirror of
https://github.com/Lemonochrme/service-architecture.git
synced 2025-06-08 13:40:50 +02:00
.. | ||
db.sh | ||
db.sql | ||
init.sql | ||
README.md |
Database Initialization
Install mariadb:
On Arch-Linux
pacman -S mariadb
sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo chown -R mysql:mysql /var/lib/mysql
sudo systemctl enable mariadb
sudo systemctl start mariadb
Create a user
sudo mariadb -u root -p
CREATE USER '<user>'@'localhost' IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON *.* TO '<user>'@'localhost' WITH GRANT OPTION;
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.
Install MariaDB on Debian
-
Update the package list:
sudo apt update
-
Install MariaDB:
sudo apt install mariadb-server mariadb-client
-
Secure the installation:
sudo mysql_secure_installation
-
Enable and start MariaDB:
sudo systemctl enable mariadb sudo systemctl start mariadb
Create a Database User
-
Access MariaDB as root:
sudo mariadb -u root -p
-
Execute the following commands to create a new user:
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:./init.sh
-
To clean up before reinitializing, execute:
./remove.sh