ODBC setup for MariaDB

Prev Next

Obtaining and installing ODBC drivers for MariaDB

If you are not using the MariaDB database provided with OneSpan Authentication Server, install the respective ODBC driver package, depending on your Linux distribution:

  • Red Hat Enterprise Linux/Rocky Linux: You can use the standard packages provided on the official MariaDB website.
  • Ubuntu Server: You can use the standard packages provided on the official MariaDB website.

Creating an ODBC data source name (DSN) for MariaDB

To create an ODBC data source name (DSN) for MariaDB

  1. Add the following lines to the ODBC driver configuration file, usually /etc/odbcinst.ini:
    [MariaDB ODBC 3.1 Driver]
    Description=MariaDB Connector/ODBC v.3.1
    Driver=driver_library
    Threading=0

    where driver_library is the file name of the ODBC driver library, e.g. /usr/lib/libmaodbc.so.

  2. Add the following lines to the data source configuration file, usually /etc/odbc.ini:
    [dsn]
    Driver=MariaDB ODBC 3.1 Driver
    DESCRIPTION=Identikey Server
    DATABASE=db_name
    OPTIONS=2
    SERVER=ip_address
    PORT=port
    
    # SSL configuration (the following lines are required only if you want to enable database encryption)
    SSLVERIFY=1
    SSLCERT=mariadb_configuration_dir/cert/client-cert.pem
    SSLKEY=mariadb_configuration_dir/cert/client-key.pem
    SSLCA=mariadb_configuration_dir/cert/ca-cert.pem
    SSLCIPHER=DHE-RSA-AES256-SHA

    where:

    • dsn is the name for the DSN, e.g. Identikey-DataSrc.
    • db_name is the name of the database to use by default.
    • OPTIONS=2 forces MariaDB to return found rows instead of the value of affected rows. This is required by OneSpan Authentication Server.
    • ip_address is the address of the computer on which the database server is installed.
    • port is the port number on which the database server listens for connection requests, by default 3306.
    • mariadb_configuration_diris the configuration folder of MariaDB, depending on the used Linux distribution, by default:
      • /etc/mysql/mariadb.conf.d (Ubuntu Server)
      • /etc/my.cnf.d (Red Hat Enterprise Linux)
    • This configures a DSN to the database using the MariaDB driver registered previously.

    For more information about the connection parameters for the DSN, refer to the MariaDB product documentation.