Using MySQL for DevTest
search cancel

Using MySQL for DevTest

book

Article ID: 74951

calendar_today

Updated On:

Products

CA Application Test CA Continuous Application Insight (PathFinder) Service Virtualization

Issue/Introduction

Here is quick steps to setup MySQL. 

The DevTest specific data is in the Install manual, the MySQL information is not, here is the cheat sheet.


Environment

All supported DevTest releases.

Cause

N/A

Resolution

Steps
1) Download MySQL DB and JDBC client (this example using JDBC Client jar version 5.1.45)
2) Install MySQL supported for the version of DevTest you are on (this example is MySQL 5.7)
3) Configure MySQL for default code page
4) Create database and user for the Enterprise Dashboard and Registry
configure Enterprise Dashboard
configure Registry 
5) check for tables and handy commands

1—
Download and install MySQL for your platform, current version is 5.7.20 (http://dev.mysql.com/downloads/mysql/)
Download and install JDBC client for MySQL referred to as Connector/J, current version is 5.1.45 (http://dev.mysql.com/downloads/connector/j/), you will need to put the .jars into your /lib/shared and /lib/dradis folders

2—
Install on disk or accept default, the following instructions are based on default
You need put the JDBC client jar into LISA classpath
Copy the mysql-connector-java-5.1.45-bin.jar to the install LISA_HOME\lib\shared and LISA_HOME\lib\dradis folders and to all LISA_HOME\lib\shared folders on each Workstation.


3—
The database needs to have the default code page set for UTF8, you will need the following files on Windows or OSX.

File Name => my.ini
location OSX=> /usr/local/mysql
location Windows => C:\ProgramData\MySQL\MySQL Server 5.7


[mysqld]
collation_server=utf8_unicode_ci
character_set_server=utf8

4—
Create 2 databases, one for Enterprise Dashboard and one for the Registry. My edbdatabase is for the Enterprise Dashboard and the regdatabase is for the Registry. One user is added to the system and associated with each database. The default login for MySQL is root with no password. Once you have set a password you will need a -p to state you are specifying one.

mysql -u root

The following command are submitted via the command line utility mysql

create database edbdatabase
default character set utf8
default collate utf8_unicode_ci;

create database regdatabase
default character set utf8
default collate utf8_unicode_ci;

grant usage on *.* to dtuser@localhost identified by 'itkorocks';
grant all privileges on edbdatabase.* to dtuser@localhost ;
grant all privileges on regdatabase.* to dtuser@localhost ;

You can now login to the mysql command line with this command, the password will be prompted. To switch between the two databases use the “use command”

mysql -u dtuser -p

use regdatabase;
use edbdatabase;

5—
The Enterprise Dashboard uses dradis.properties to set the edbdatabase.

File Name=> dradis.properties

 

dradis.db.internal.enabled=false

 

dradis.db.driverClass=com.mysql.jdbc.Driver
dradis.db.url=jdbc:mysql://localhost:3306/edbdatabase
dradis.db.user=dtuser
dradis.db.password=itkorocks

 

The Registry uses the site.properties to specify the MySQL database regdatabase.

File Name=> site.properties

lisadb.acl.poolName=common
lisadb.broker.poolName=common
lisadb.reporting.poolName=common
lisadb.dradiscache.poolName=common

lisadb.pool.common.driverClass=com.mysql.jdbc.Driver
lisadb.pool.common.url=jdbc:mysql://localhost:3306/regdatabase
lisadb.pool.common.user=dtuser
lisadb.pool.common.password=itkorocks

lisadb.internal.enabled=false

5—
Once you start up the database you can see the default code pages, they should look similar to this:

mysql> show variables like 'char%';
+--------------------------+---------------------------------------------------------+
| Variable_name            | Value                                                   |
+--------------------------+---------------------------------------------------------+
| character_set_client     | utf8                                                    |
| character_set_connection | utf8                                                    |
| character_set_database   | utf8                                                    |
| character_set_filesystem | binary                                                  |
| character_set_results    | utf8                                                    |
| character_set_server     | utf8                                                    |
| character_set_system     | utf8                                                    |
| character_sets_dir       | C:\Program Files\MySQL\MySQL Server 5.7\share\charsets\ |
+--------------------------+---------------------------------------------------------+
8 rows in set (0.00 sec)


To see a database and tables use this while logged in as root:

show databases;
show tablesin edbdatabase;
show tablesin regdatabase;

To export or backup database to send to someone use this:

C:\Program Files\MySQL\MySQL Server 5.7\bin>mysqldump --user=dtuser --password=itkorocks regdatabase > c:\regdatabase.sql

 

 

Additional Information

NOTE:

Recommended to install MySQL Workbench if running on a Windows platform or a Linux platform that accepts GUI, it is much easier to create schemas and users.