|
|||
|
5.6 Database CommandsJanuary 24th, 2026 The database can be manually controlled by an experienced DBA, although this should not be required. There are several commands for adjusting how the database runs. 5.6.1 bear_database_backupPerforms a backup of the database instance and places that backup in bear/backups/database Usagebear_database_backup Example# bear_database_backup 5.6.2 bear_database_binlogEnables or disables binary logging in MariaDB. Alternatively, with no arguments it will report the current status binary logging. It should be noted that binary logging should be enabled for almost any scenario including test systems. In rare cases, it may be desirable to get a slight performance gain from disabling binary logging but this provides zero fault recovery. Binary logging should only be disabled if the BEAR deployment is essentially considered disposable. Usagebear_database_binlog [on|off] ExampleGetting the current binary logging status # ./bear_database_binlog Binary logging is currently enabled (on). Disabling binary logging # ./bear_database_binlog off Binary logging has been deactivated (off). 5.6.3 bear_database_get_sizesProvides a summary report of all the sizes for each tenant database. Usagebear_database_get_sizes Example# ./bear_database_get_sizes Database 'events' consumes: 1 MiB on disk. Database 'mysql' consumes: 2 MiB on disk. Database 'performance_schema' consumes: 1 MiB on disk. Database 'session' consumes: 1 MiB on disk. Database 'test' consumes: 1 MiB on disk. /bear/database file system usage... Filesystem 1M-blocks Used Available Use% Mounted on /dev/mapper/cl-root 17394 3190 14205 19% / 5.6.4 bear_database_passwdSets both the instance root password and the accepted network connection mask. This command must be run once after a new installation of the BEAR database otherwise clients will be unable to connect to it. It can also be used to get a list of valid users and network connection masks which can be useful when troubleshooting client connection failures. UsageUSAGE 1: bear_database_passwd <CURRENT_IP_PREFIX> <CURRENT_PASSWORD> <NEW_IP_PREFIX> <NEW_PASSWORD> USAGE 2: bear_database_passwd <CURRENT_IP_PREFIX> <NEW_IP_PREFIX> USAGE 3: bear_database_passwd getinfo ExamplesDisplaying current users # ./bear_database_passwd getinfo Password: +--------+---------------+ | User | Host | +--------+---------------+ | root | 127.0.0.1 | | bear | 192.168.1.% | | root | 192.168.1.% | | root | ::1 | | | bear-database | | root | bear-database | | | localhost | | backup | localhost | | bear | localhost | | root | localhost | +--------+---------------+ Setting a new root user and network connection mask (interactive) # ./bear_database_passwd 0.0.0.0 192.168.1. Current password: ******** New password: ******** Confirm password: ******** BEAR database root password updated. Setting a new root user and network connection mask (non interactive) # ./bear_database_passwd 0.0.0.0 Abcd1234 192.168.1. SomePassword123 BEAR database root password updated. 5.6.5 bear_database_reconfigRebuilds the MariaDB instance configuration file. This command is generally called by other commands such as start_dtatabase but can also be used directly. The main use for this to be run manually is to repair a broken manually altered /etc/mysql.cnf file with one based on the default template in the event the database fails to start after user tampering. Usagebear_database_reconfig 5.6.6 restart_databaseRestarts the database following the following sequence:
Usagerestart_database 5.6.7 start_databaseMakes the BEAR database persistently active by performing three steps in order:
It is important to note that this is not a normal startup command but a persistent state command. If called, then the BEAR database will remain as an auto start service (starts after reboot) as mariaDB until stopped with stop_database. Usagestart_database 5.6.8 stop_databaseStops and persistently disables the BEAR database by performing two steps in order:
Once stopped using this command, the BEAR database will be completely disabled and will not restart following a reboot. Usagestop_database
|
||