Install MySQL

From Fusion Registry Wiki
Revision as of 13:35, 23 May 2022 by Plazarou (talk | contribs) (Troubleshooting MySQL)
Jump to navigation Jump to search

Overview

Fusion Registry needs an operating database to store the structural metadata, configuration settings and other operating information like audit logs. MySQL, Oracle and SQL Server are supported. If you already have one of those services available, use that and simply create a new schema for Fusion Registry to use.

For versions of the Fusion Registry up to version 11, the MySQL database or eqivalent services like MariaDB must be MySQL 5.7 compatible.

For versions of the Fusion Registry from version 11 onwards, MySQL version 8 may be used.


Installing MySQL 5.7

Download and install MySQL 5.7 Community.

Creating the Fusion Registry schema

We recommend that you create a dedicated schema for Fusion Registry to use. You can do that using the mysqlsh command line interface, but a simple option is to install the MySQL Workbench which provides a graphical user interface for Windows users.

MySQL Workbench GUI

Download and install MySQL Workbench.

Using MySQL Workbench, connect to your MySQL database service and create a new schema. There's a button on the toolbar to do that.

MySQLWorkbench.PNG

It's usual to give the schema a name like fusion_registry, but there's no restrictions so call it what you like. You'll tell Fusion Registry the name of the schema to use during the install process.

Troubleshooting MySQL

This section details issue you may encounter when using MySQL.

Error: bad SQL grammar: The used command is not allowed with this MySQL version

If you encounter an error like the following:

 org.springframework.jdbc.BadSqlGrammarException: StatementCallback; 
 bad SQL grammar [LOAD DATA LOCAL INFILE 'C:/tomcats/apache-tomcat-9.0.58/temp/matrixBL_1424624886700320079.tmp' INTO TABLE METATECH_DELETE_TEST_1_0_KEY FIELDS TERMINATED BY ','  ENCLOSED BY '"'   
   LINES TERMINATED BY  (  ID,FR_PROVIDER_ACY,FR_PROVIDER_ID,FR_PROVISION,FR_UPDATED_DATE,FR_GROUP_ID,DIM_A,DIM_B,SER_ATT_B,SER_ATT_A)  ]; 
 nested exception is java.sql.SQLSyntaxErrorException: The used command is not allowed with this MySQL version

This is where MySQL has been configured to not allow the command LOAD DATA LOCAL INFILE. By default, this is disabled as it is considered a security risk to be able to load data this way !! In particular:

 LOAD DATA LOCAL INFILE is disabled by default because it poses a security risk. A malicious server or proxy could send a fake “local infile request” packet to the client and read any file that the client has permission to open.

From: https://mysqlconnector.net/troubleshooting/load-data-local-infile/

MySQL 5.X seems to have the value of local_infile set to "true" or "ON" by default, whereas MySQL 8.X appears to have this value set to "false" or "OFF"

To enable the loading of data, run the following:

 SHOW GLOBAL VARIABLES LIKE 'local_infile';

This should show a value of "ON"

If it doesn't run the following:

 SET GLOBAL local_infile = TRUE;