top of page

How to use and configure an external database with Squash TM?

Squash TM comes with an embedded H2 database for testing purpose only. To use it in production, you need to connect Squash TM to a MariaDB or PostgreSQL database.


Use a MariaDB database

Step 1: Configure MariaDB

  • Create a new database with UTF8 encoding for Squash TM, and grant all rights on this database for a user: CREATE DATABASE IF NOT EXISTS squashtm CHARACTER SET utf8 COLLATE utf8_bin; CREATE USER 'squash-tm'@'localhost' IDENTIFIED BY 'my_password'; GRANT ALL ON squashtm.* TO 'squash-tm'@'localhost'; FLUSH PRIVILEGES;

  • Create a user with the grants select/insert/update/delete/create temporary tables on this database.

  • Check the following information in the MariaDB configuration file (my.cnf or my.ini): default-storage-engine = InnoDB max_allowed_packet=X (where X is the max authorized size of attachments by Squash. By default, the application is set to 2Mo,ie X=2M)

  • Restart MariaDB


Step 2: Populate Squash TM database

  • Use the script 'mysql-full-install.sql' found in the folder 'database-scripts/' of the Squash TM package to populate the database you just created (the database administrator executing this script must have SUPER privilege).


Step 3: Configure Squash TM to use the MariaDB database

  • Edit the following parameters in the startup file: DB_TYPE=mysql DB_URL=jdbc:mysql://localhost:3306/squashtm DB_USERNAME=squash-tm DB_PASSWORD=my_password

  • You can use the user created above with the grants select/insert/update/delete/create temporary tables on the database.



Step 4 : Launch Squash TM

  • Restart Squash TM

  • Log on Squash TM with default administrator login admin/admin



Use a PostgreSQL database


Step 1: Configure PostgreSQL

  • Make sure that the plpgsql and uuid-ossp extensions are available with your PostgreSQL installation, by checking that they appear when you run the select * from pg_available_extensions; command. Contact your database administrator if this is not the case.

  • Create a new database with UTF8 encoding for Squash TM, and grant all rights on this database for a user: CREATE DATABASE squashtm WITH ENCODING='UTF8'TEMPLATE = template0; CREATE USER "squash-tm" WITH PASSWORD 'my_password'; GRANT ALL PRIVILEGES ON DATABASE squashtm TO "squash-tm";

Step 2: Populate Squash TM database

  • Use the script 'postgresql-full-install.sql' found in the folder 'database-scripts/' of the Squash TM package to populate the database you just created (the database administrator executing this script must have SUPERUSER privileges).


Step 3: Configure Squash TM to use the PostgreSQL database

  • Edit the following parameters in the startup file: DB_TYPE=postgresql DB_URL=jdbc:postgresql://localhost:5432/squashtm DB_USERNAME=squash-tm DB_PASSWORD=my_password


Step 4 : Launch Squash TM

  • Restart Squash TM

  • Log on Squash TM with default administrator login admin/admin

Comments


bottom of page