Skip to content
brianmather edited this page Jan 8, 2014 · 30 revisions

Describes switching the ThreadFix database to MySQL

Introduction

These instructions apply to version 2.0M1 and 1.1 of ThreadFix only. They are likely to change in later releases.

To switch ThreadFix to use MySQL instead of HSQL, you'll need to have a couple things ready:

A ThreadFix instance ([http://code.google.com/p/threadfix/downloads/list available here])

A MySQL instance ([http://www.mysql.com/downloads/ available here])

Once you have these things, you can start with the instructions in the next section.

These instructions refer to the ThreadFix 2.0M1 zip package, although they should be easy to adapt for other environments.

ThreadFix Configuration

First, if ThreadFix doesn't have a folder in tomcat/webapps, unzip the threadfix.war file to a folder named threadfix. Starting the server will unzip the WAR automatically.

  • Go to tomcat/webapps/threadfix/WEB-INF/classes.
  • Delete the file jdbc.properties.
  • Rename jdbc.properties.mysql to jdbc.properties.
  • Edit lines 15 and 16 or jdbc.properties to reflect your username and password.
  • If your MySQL instance is on another machine, you will need to edit line 14 and replace localhost with the name of the other machine.
  • Only for 1.0.1 users! Download and copy the MySQL JDBC driver JAR file into the ThreadFix lib folder (at ThreadFix\tomcat\webapps\threadfix\WEB-INF\lib).

Now everything is done on the ThreadFix side. We still need to import data into MySQL.

ThreadFix Configuration

Create the Tables

If the ThreadFix MySQL user does not have permissions to create databases (it is not recommended to run as root, for example) create a database named threadfix in MySQL.

At this point, start ThreadFix and verify that it starts. This will create tables in MySQL if done correctly. You can verify that tables have been created by entering the MySQL shell and executing the commands

{{{ use threadfix; show tables; }}}

Number of results depend on version.

  • 68 results (version 2.0M1)
  • 61 results (version 1.1)
  • 57 results (version 1.0.x)

All the tables will be empty at this point.

Import Mapping Data

Once these tables exist, let's import the ThreadFix mapping data. From inside the MySQL shell, execute:

{{{ source ${ThreadFix_Package_Base}\tomcat\webapps\threadfix\WEB-INF\classes\import.sql }}}

Clone this wiki locally