SQL database

From aquarium-doc
Revision as of 14:29, 24 March 2023 by Uwe (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Aquarium Control uses MariaDB.

Installation

Use the following commands to install MariaDB:

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt install mariadb-server
  • sudo apt-get install libmariadb-dev
  • sudo apt-get install libmariadb-dev-compat
  • sudo apt-get install libgsl-dev

The commands are also inside the libinstall script inside the repository of aquarium-ctrl.

Backup

Manual backup works as following:

  • Export of database with sudo mysqldump -u root aquarium > name_of_backup.sql
  • Transfer of data to alternative storage
  • Before restoring, create the database aquarium on the new device (log in with sudo mysql -u root and execute create database aquarium;)
  • Restoring data from backup works with sudo mysql -u root aquarium < name_of_backup.sql

Create user

Create user "aquarium" with matching password when restoring on a new device:

  • log in with sudo mysql -u root
  • execute create user aquarium identified by 'password';
  • execute grant all privileges on aquarium.* to aquarium with grant option;

Maintaining the database

Use phpmyadmin to administrate user rights. Installation is done with the following steps:

  • sudo apt install phpmyadmin
  • Choose the Apache web server for configuration. This will automatically trigger the installation of Apache.

Structure of database

The database contains the following tables: