Prepare the runtime environment - connecting to the database
- Check that the required ODI database driver is available in
FGLDIR/dbdrivers.
- For Oracle® MySQL 5.5 and 5.6, you must have the MySQL database driver
"
dbmmys_5_5
". - For Oracle MySQL 5.7, you must have the MySQL database driver "
dbmmys_5_7
". - For Oracle MySQL 8.0, you must have the MySQL database driver "
dbmmys
" ("dbmmys_8_0
"). - For MariaDB 10.0/10.1, you must have the MySQL database driver
"
dbmmys_5_5
". - For MariaDB 10.2+, you must have the MariaDB database driver "
dbmmdb
" ("dbmmdb_10_2
").
- For Oracle® MySQL 5.5 and 5.6, you must have the MySQL database driver
"
- Check that the MySQL/MariaDB database client software is available on the system.
- For MySQL, check that the libmysqlclient.* library is installed on the system. The shared library version of the MySQL client library must match the libmysqlclient library version linked to the dbmmys.so ODI driver.
- For MariaDB 10.0 and 10.1, check that the libmysqlclient.so.18 library is installed on the system: This is the shared library linked to the dbmmys_5_5.so ODI driver.
- For MariaDB 10.2 and +, check that the libmariadb.* library is installed on the system. The shared library version of the MariaDB client library must match the libmariadb library version linked to the dbmmdb.so ODI driver.
- Make sure that the MySQL/MariaDB client environment variables are properly set.Check for example MYSQL_HOME (the path to the installation directory), DATADIR (the path to the data files directory), etc. See MySQL documentation for more details about client environment variables to be set.
- Check the MySQL/MariaDB client configuration options in the my.cnf file on
your MySQL client environment.
The driver will read the options defined in the
[client]
configuration group of the my.cnf file defined for the client application. Note that you can specify a particular configuration file with the following FGLPROFILE parameter:dbi.database.dbname.mys.config = "/opt/var/myapp/my.cnf"
or, for MariaDB:dbi.database.dbname.mdb.config = "/opt/var/myapp/my.cnf"
-
Check the database client locale settings
(
default-character-set
option in the my.cnf configuration file).The database client locale must match the locale used by the runtime system (LC_ALL, LANG). For example, in order to define (4-bytes) UTF-8 as MySQL client character set:[client] default-character-set="utf8mb4"
-
Verify the environment variable defining the search path for the database
client shared library (libmysqlclient.so on UNIX™, LIBMYSQL.dll on Windows®).
Table 1. Shared library environment setting for MySQL MySQL version Shared library environment setting MySQL 5.5 and higher and MariaDB 10.x UNIX : Add $MYSQL_HOME/lib to LD_LIBRARY_PATH (or its equivalent).
Windows : Add %MYSQL_HOME%\bin to PATH.
- To verify if the MySQL/MariaDB client environment is correct, start the SQL command
interpreter:
$ mysql dbname -u appadmin -p
-
Set up the fglprofile entries for database
connections.
-
Define the MySQL/MariaDB database driver:
For MySQL:
For MariaDB:dbi.database.dbname.driver = "dbmmys"
dbi.database.dbname.driver = "dbmmdb"
-
The "
source
" parameter defines the name of the MySQL/MariaDB database.dbi.database.dbname.source = "test1"
-
Define the MySQL/MariaDB database driver: