Difference between revisions of "SQL database"
From aquarium-doc
Jump to navigationJump to search
| Line 3: | Line 3: | ||
== Installation == | == Installation == | ||
Use the following commands to install MariaDB: | Use the following commands to install MariaDB: | ||
* <code>sudo apt-get update</code> | |||
<code>sudo apt-get update</code> | * <code>sudo apt-get upgrade</code> | ||
* <code>sudo apt install mariadb-server</code> | |||
<code>sudo apt-get upgrade</code> | * <code>sudo apt-get install libmariadb-dev</code> | ||
* <code>sudo apt-get install libmariadb-dev-compat</code> | |||
<code>sudo apt install mariadb-server</code> | * <code>sudo apt-get install libgsl-dev</code> | ||
<code>sudo apt-get install libmariadb-dev</code> | |||
<code>sudo apt-get install libmariadb-dev-compat</code> | |||
<code>sudo apt-get install libgsl-dev</code> | |||
The commands are also inside the <code>libinstall</code> script inside the repository of aquarium-ctrl. | The commands are also inside the <code>libinstall</code> script inside the repository of aquarium-ctrl. | ||
| Line 26: | Line 20: | ||
* keep in mind to create user "aquarium" with matching password when restoring on a new device | * keep in mind to create user "aquarium" with matching password when restoring on a new device | ||
== | == Maintaining the database == | ||
Use phpmyadmin to administrate user rights. | |||
Installation is done with the following steps: | |||
* <code>sudo apt-get install apt</code> | |||
== Structure of database == | |||
The database contains the following tables: | The database contains the following tables: | ||
Revision as of 14:16, 24 March 2023
Aquarium Control uses MariaDB.
Installation
Use the following commands to install MariaDB:
sudo apt-get updatesudo apt-get upgradesudo apt install mariadb-serversudo apt-get install libmariadb-devsudo apt-get install libmariadb-dev-compatsudo 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
aquariumon the new device (log in withsudo mysql -u rootand executecreate database aquarium;) - Restoring data from backup works with
sudo mysql -u root aquarium < name_of_backup.sql - keep in mind to create user "aquarium" with matching password when restoring on a new device
Maintaining the database
Use phpmyadmin to administrate user rights. Installation is done with the following steps:
sudo apt-get install apt
Structure of database
The database contains the following tables: