Install ODBC Connectors

Oracle and MySQL ODBC connectors are only supported on Linux and Solaris platforms.

Install MySQL ODBC Connector on Linux

  1. Create the database and grant user privileges. On the host where MySQL server is installed, run:
    # mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 11
    Server version: 5.6.45 MySQL Community Server (GPL)
    Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
                
    mysql> use mysql;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
                
    Database changed
    mysql> create database pbtest;
    Query OK, 1 row affected (0.00 sec)
                
    mysql> create user 'testuser'@'locahost' identified by '<passwd>';
    Query OK, 0 rows affected (0.00 sec)
                
    mysql> grant all on pbtest.* to 'testuser' identified by '<passwd>';
    Query OK, 0 rows affected (0.00 sec)
                
    mysql> grant all on pbtest.* to 'root' identified by ‘<passwd>';
    Query OK, 0 rows affected (0.00 sec)
        
    mysql> ^DBye
  2. The steps below are to be done on the log server, where only MySQL ODBC connector needs to be installed. The example below is from a CentOS 6 system:
    # yum install mysql-connector-odbc

mysql-connector-odbc version 5.3.14 is not supported.

  1. In pb.settings set:
    eventdestinations authevt=odbc=MySQL
    odbcinidir  /opt/pbul/etc

    If you are using mysql-connector-odbc version 5.3.x with SSL enabled on MySQL server or mysql-connector-odbc version 8.0.x (with or without SSL), in pb.settings file, you need to configure the setting loadssllibs to yes.

    cat /etc/pb.settings | grep loadssllibs
    loadssllibs                         yes
    
  2. Copy /etc/odbcinst.ini to /opt/pbul/etc.
  3. Make sure the libraries are set correctly (if 64-bit machine, driver64 and setup64).
[MySQL] 
Description= ODBC for MySQL xml:space="preserve">
Driver= /usr/lib/libmyodbc5.so
Setup= /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup64= /usr/lib64/libodbcmyS.so
FileUsage = 1
UsageCount = 3
trace = no
tracefile = stderr
  1. Create /opt/pbul/etc/odbc.ini:
    [MySQL]
    Description = ODBC for MySQL
    Driver = MySQL
    server = <ip-address>
    port = 3306
    user = root
    password = <passwd>
    database  = pbtest
    trace = no
    tracefile = stderr

In the file above, <ip-address> is the IP address of the host where the database was created (in step 1). <passwd> is the root password as set up on that host.

  1. On some Linux platforms, such as Debian, you might also need to add the following highlighted line to /etc/systemd/pblighttpd.service. In the example below, /usr/local/unixODBC is where unixODBC was installed, and /usr/local/MySQL/lib is where the MySQL libraries libmyodbc5.so is located:
# cat /etc/systemd/system/pblighttpd.service
[Unit]
Description=BeyondTrust PowerBroker REST services
After=network.target
        
[Service]
ExecStart=/usr/lib/beyondtrust/pb/rest/sbin/pblighttpd-svc
ExecReload=/bin/kill -HUP $MAINPIDEnvironment="LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/local/unixODBC/lib:/usr/local/MySQL/lib:"

[Install]
WantedBy=multi-user.target
  1. Restart pblighttpd.
  2. Run pbrun and verify using:
    # pblog --odbc -f MySQL
    
  3. Check pbrest.log and other logs to make sure there is no error.