Use MySQL or MariaDB as your repository database (Archive installation)
Use these steps to install MySQL or MariaDB as the host database for the Pentaho Server in an archive installation of Pentaho.
Prerequisites
Before you prepare your Pentaho Repository, prepare either a Windows or Linux environment:
MySQL Connector/J 8.0 cannot be used when configuring Tomcat with the JDBC driver JAR.
Components
The Pentaho Repository resides on the database you installed during the environment preparation step.
It includes these components:
Jackrabbit Contains the solution repository, examples, security data, and content data from reports that you create.
Quartz Holds data related to scheduling reports and jobs.
Hibernate Holds data related to audit logging.
(Optional) Pentaho Operations Mart Reports on system usage and performance.
Initialize the repository database
To initialize MySQL or MariaDB so that it serves as the Pentaho Repository, run several SQL scripts to create the Hibernate, Quartz, Jackrabbit (JCR), and Pentaho Operations Mart components.
Use the ASCII character set when you run these scripts. Do not use UTF-8. UTF-8 can trigger string-length limits that can make scripts fail.
If your user, password, host, or port differs, update the examples to match your environment.
Pentaho 10.2.0.0 and earlier use Quartz 1.x tables with the QRTZ5_ prefix. Pentaho 10.2.0.1 and later use Quartz 2.x tables with the QRTZ6_ prefix.
When upgrading to 10.2.0.1 or later, you must create the QRTZ6_ tables by re-running the Quartz database creation step. You can then optionally migrate schedules using the provided migration script.
Back up your data before you run any SQL scripts.
Failure to complete the Quartz upgrade results in a Pentaho Server start-up error. In addition to the server error, the following exception message is generated in the catalina.log file:
Step 1: Change default passwords
For production, follow best practices and change the default passwords in the SQL script files.
If you are evaluating Pentaho, you can skip this step.
Browse to the
<your pentaho directory>/pentaho-server/data/mysqlfolder.Use a text editor to update these scripts as needed for your existing user, password, database, and other values:
create_jcr_mysql.sqlcreate_quartz_mysql.sqlcreate_repository_mysql.sqlpentaho_mart_mysql.sql
Save and close the files.
Step 2: Run SQL scripts
When upgrading from previous Pentaho versions (including 10.2.0.0 GA to 10.2.0.1 and later), you must manually initialize a new Quartz database. This creates a new Quartz library in the repository database.
If you want to keep existing Quartz schedules, migrate the old tables to the new tables.
You may need administrator permissions to run these scripts on the host OS.
Back up your data. See Back up your existing Pentaho products and install Pentaho 11.0.
If the Pentaho Server is running, stop it. See Stop and start the Pentaho Server and repository.
Make sure your MySQL or MariaDB instance is running.
Open MySQL Workbench or a MySQL/MariaDB command prompt.
Run the SQL creation scripts in this order:
<your pentaho directory>/pentaho-server/data/mysql/create_jcr_mysql.sql<your pentaho directory>/pentaho-server/data/mysql/create_quartz_mysql.sql<your pentaho directory>/pentaho-server/data/mysql/create_repository_mysql.sql<your pentaho directory>/pentaho-server/data/mysql/pentaho_mart_mysql.sql
This creates the Quartz database, the Jackrabbit and MySQL/MariaDB repositories, and Pentaho Operations Mart.
The scripts create the new Quartz scheduler tables prefixed with
QRTZ6_.Any existing
QRTZ5_tables are retained. Starting the Pentaho Server at this point results in an empty schedule.If you want to retain your existing scheduler data, open
migrate_old_quartz_data_mysql.sqlin a text editor.Update the migration script for your user, password, database, and other values. Save the file.
Run the migration script:
<your pentaho directory>/pentaho-server/data/mysql/migrate_old_quartz_data_mysql.sql
The original Quartz scheduler database is migrated to the new Quartz database.
The original QRTZ5_ data is retained. You can delete it after you confirm migration success.
You unpacked the Pentaho Operations Mart SQL file while preparing your environment for the archive installation.
See Prepare your Windows environment for an archive install or Prepare your Linux environment for an archive install.
Step 3: Verify MySQL or MariaDB initialization
Unless you changed it in Step 1, the default password for each username below is password.
After you run the scripts, verify the databases and user roles were created properly:
Open MySQL Workbench.
Log in as
hibuser.Under Schemas, expand hibernate > Tables.
If you installed Pentaho Operations Mart, expand pentaho_operations_mart > Tables.
Log in as
jcr_user.Under Schemas, expand jackrabbit > Tables.
The Jackrabbit tables might not appear until after you start Pentaho for the first time.
Log in as
pentaho_user.Under Schemas, expand quartz > Tables.
Exit MySQL Workbench.
You have initialized the MySQL or MariaDB Pentaho Repository database.
Configure the repository database
Now that you have initialized your repository database, configure Quartz, Hibernate, Jackrabbit, and Pentaho Operations Mart for MySQL or MariaDB.
The examples assume MySQL on port 3306 with default passwords.
If your port or password differs, update the examples to match your environment.
Step 1: Set up Quartz on MySQL or MariaDB
Quartz stores scheduler data, such as scheduled reports.
You point Pentaho at the correct JobStore by updating quartz.properties.
Open
pentaho/server/pentaho-server/pentaho-solutions/system/scheduler-plugin/quartz/quartz.properties.In
#_replace_jobstore_properties, setorg.quartz.jobStore.driverDelegateClass:
Save the file.
Step 2: Set Hibernate settings for MySQL or MariaDB
Hibernate settings point Pentaho to the correct Hibernate configuration file.
Hibernate also stores the audit logs used by Operations Mart.
Files are in pentaho/server/pentaho-server/pentaho-solutions/system/hibernate.
Open
hibernate-settings.xml.Find the
<config-file>entry. Replacepostgresql.hibernate.cfg.xmlwithmysql5.hibernate.cfg.xml:
From:
To:
Save and close the file.
(MariaDB only) Open
mysql5.hibernate.cfg.xml.Find the driver class and change it from MySQL to MariaDB:
From:
To:
Step 4: Modify Jackrabbit repository information for MySQL or MariaDB
Update Jackrabbit to use the MySQL (or MariaDB) repository.
Open
pentaho/server/pentaho-server/pentaho-solutions/system/jackrabbit/repository.xml.Uncomment the MySQL lines.
Comment out the MS SQL Server, Oracle, and PostgreSQL lines.
Verify these sections use the MySQL values.
Item
Code Section
Repository
DataStore
Workspaces
PersistenceManager (1st part)
Versioning
PersistenceManager (2nd part)
DatabaseJournal
Perform Tomcat-specific connection tasks
After your repository is configured, configure the web application server to connect to the Pentaho Repository.
In this step, you will make JDBC and JNDI connections to the Hibernate, Jackrabbit, and Quartz components.
By default, the Pentaho Server software is configured to deploy and run on Tomcat. Connections are already specified. Only update the Tomcat context.xml file if you changed default ports or passwords.
Step 1: Download driver and apply to the Pentaho Server
To connect to a database, including the Pentaho Repository database, download and copy a JDBC driver to the right locations for the Pentaho Server and the web application server.
Due to licensing restrictions, Pentaho cannot redistribute some third-party database drivers. You must download and install these files yourself.
Download a JDBC driver JAR from your database vendor or a third-party driver developer. The JDBC drivers reference lists supported drivers.
Copy the JDBC driver JAR to the
pentaho/server/pentaho-server/tomcat/libfolder.Copy the
hsqldb-2.3.2.jarfile topentaho-server/tomcat/libif you want to keep the Pentaho sample.
Step 2: Modify JDBC connection information in the Tomcat XML file
Database connection and network settings (username, password, driver class, IP address or domain name, and port numbers) for your Pentaho Repository database are stored in the context.xml file.
Update this file to match your environment.
If you have a different port, password, user, driver class, or IP address, update the examples to match your environment.
Consult your database documentation to determine the JDBC class name and the connection string for your Pentaho Repository database.
Go to
server/pentaho-server/tomcat/webapps/pentaho/META-INFand opencontext.xmlin a text editor.Add the following code if it does not already exist.
For MySQL:
For MariaDB:
Update usernames, passwords, driver classes, IP addresses (or domain names), and port numbers to match your environment.
Comment out resource references for databases you are not using.
Verify
validationQueryis set toselect 1(for example:validationQuery="select 1").Save
context.xml, then close it.
Start the Pentaho Server
Now that you have completed the initial Pentaho archive installation steps, you are ready to start the Pentaho Server.
Last updated
Was this helpful?

