Introduction


This article descibes basic information on the MariaDB. The custo diagnostic server can work with MariaDB databases. (https://mariadb.org/). MariaDB is an open-source MySQL database.


Installation

The installation runs through the setup, a service is installed "diagserverdb". This service runs mysqld.exe server, which provides the data.

Default setting: c:\Program Files\custo diagnostic server\mariadb\bin\mysqld.exe "--defaults-file=c:\diagserverdata\Default call:mariadb\my.ini" "diagserverdb"

Services

The database runs on the localhost of the server with port TCP 3306.

By default, the MariaDB server data is located in the same directory as the .cst files in the MariaDB


Configuration File

The default location is here: c:\diagserverdata\mariadb\my.ini

And describes the location, data directories and port of the database.

Tools

Basic tool to work with the database: HeidiSQL https://www.heidisql.com/


Extended tool (fee required, except express version): dbForge Studio for MySQL https://www.devart.com/de/dbforge/mysql/studio/

Logfiles

The main logfile is *.err and is located in c:\diagserverdata\mariadb

The name consists of the server computer name and the file extension .err

https://mariadb.com/kb/en/library/overview-of-mariadb-logs/


Issues during installation / Reinstallation

If you reinstall the custo diagnostic server for update purposes (but you should actually use the update function of the setup), errors may occur under certain circumstances.

After uninstalling custo diagnostic server you should first check that no "mysql" process is running, this should be checked in the Task Manager. If this is the case, the process should be killed or the computer should be restarted. You should also check that the program directory of the custo diagnostic server is completely removed. Under certain circumstances, a reboot should also be performed for this purpose.

If the error occurs after the new installation that the database can no longer be started, you can correct the error by first uninstalling the custo diagnostic server again as described above. Then you must delete the multi-master.info, all *relay* files and all *.info files in the database directory. Afterwards, you should try a new installation.  


Importing the backup

In the Diag data directory there are SQL scripts in the "backup" directory that represent a backup of the entire Diag database in MariaDB. These scripts can be reimported for backup purposes. However, it may be necessary to make a backup before importing the backup itself (see "Making a Backup")

For the following instructions please run a Windows CMD Shell as administrator.
First the diagserver must be shut down:

Command
net stop diagserver

But the diagserverdb service (i.e. MariaDB) must still be running!

Now you can import the backup file with the following command to overwrite the database with the backup. For this we need the password for the database. You will find the password in the file "conf\diag.properties" located in the custo diagnostic server installation directory. This file contains the entry diag.dbPass=[...]. The password is the characters after the "=".

We first change to the directory with the backup files and then execute the mysql command located in the installation directory of the custo diagnostic server below "mariadb\bin".

Command
"Path-to-mysql-bin-Directory"\mysql.exe -uroot -p<Password> diagdb < "Path-to-Backup-Files"\YYYY-MM-DD.db.backup.sql
Example
"C:\Program Files\custo diagnostic server\mariadb\bin\mysql.exe" -uroot -pSECRET diagdb < "C:\diagserverdata\backup\2020-04-22.db.backup.sql"

This would bring in the backup from DD.MM.YYYY. Please replace this with the filename with the backup you will have to restore. Please note:

  • The password comes after -p but without spaces!
  • The user comes after -u without spaces and is always root
  • After the password comes the name of the database, which is called diagdb

Afterwards you can restart the custo diagnostic server:

Command
net start diagserver

Create a Backup

You can make a backup at any time manually (even when the custo diagnostic server is running). To do so, you need the password of the database, as in "Importing the backup". The following command is used for this:

Command
"Path-to-mysql-bin-Directory"\mysqldump.exe -uroot -p<Passwort> -r "Path-to-Backup-Files"\backup.sql diagdb
Example
"C:\Program Files\custo diagnostic server\mariadb\bin\mysqldump.exe" -uroot -pSECRET -r "C:\diagserverdata\backup\2020-04-22-002.db.backup.sql" diagdb

This command creates the file backup.sql which contains a backup of the database diagdb.

Automatic Backups

Are created automatically. First one hour after server start, then every 24h. The default location is "diagserverdata\backup".


  • No labels