Skip to content

Munkireport Database

Arjen van Bochoven edited this page Mar 4, 2021 · 12 revisions

MunkiReport is database agnostic, which means that you could store the data in a variety of database engines (MySQL or Sqlite are currently supported). The database consists of tables, each with their own set of data. All tables in MunkiReport are created using a model. Models live either in /app/models or are available as /module/module_name/module_name_model.php If you inspect the model file, you can figure out what the name of the table is, and which columns are available.

SQLite

Setup

By default, MunkiReport installs with SQLite enabled. The database is stored in app/db/db.sqlite

Configuration

Available variables include the following:

CONNECTION_DRIVER="sqlite"
CONNECTION_DATABASE="db/db.sqlite"

You should only need to change this value if you want to move your db to a non-standard location.

Troubleshooting

If Munkireport is complaining about a read-only database: Make sure the database directory is writable by the webserver

MySQL

Setup

MySQL version 5.7.7 or higher MariaDB 10.2.2 or higher is required for MunkiReport 2.7 and above. Installation instructions are available for MySQL and MariaDB. The database may be hosted on another server or locally installed.

To use MySQL, in MunkiReport v3.3 and above, edit the .env file and add the following configuration options for your database server. (configuration examples for < v3.3 can be found in the config_default.php file)

Configuration

Available variables include the following:

CONNECTION_DRIVER="mysql"
CONNECTION_HOST="127.0.0.1"
CONNECTION_PORT=3306
CONNECTION_DATABASE="munkireport"
CONNECTION_USERNAME="root"
CONNECTION_PASSWORD=""
CONNECTION_CHARSET="utf8mb4"
CONNECTION_COLLATION="utf8mb4_unicode_ci"
CONNECTION_STRICT=TRUE
CONNECTION_ENGINE="InnoDB"

Once you have installed MySQL, you will need to add the database named 'munkireport' to MySQL otherwise it won't be able to run the migrations. To do this open a MySQL Command Line and type: create database munkireport;

Troubleshooting

If you are having migration errors, it is possible that your database version is below the recommendation. You also may have character set issues with the database itself, with some older versions of MunkiReport/MySQL defaulting to utf8 or some other version that is not fully compatible. To resolve this, open the MySQL Installer and run through the wizard. When it asks for the authentication method, make sure to select 'Use Legacy Authentication Method'.

Clone this wiki locally