This section describes how to create and configure a Azure MySQL Data Source Name (DSN) running in a container environment. Please follow the steps below.
-
In your container, launch a command line.
-
Type the commands to install the latest MySQL ODBC database driver.
> apt-get update
> apt-get upgrade
> apt-get install -y wget #install wget lib
> cd /
> mkdir download
> cd download
> wget https://dev.mysql.com/get/Downloads/Connector-ODBC/8.0/mysql-connector-odbc-8.0.32-linux-glibc2.28-x86-64bit.tar.gz
> tar -xvf mysql-connector-odbc-8.0.32-linux-glibc2.28-x86-64bit.tar.gz
> mkdir /usr/local/mysql
> cp -R mysql-connector-odbc-8.0.32-linux-glibc2.28-x86-64bit/lib/ /usr/local/mysql
> cp -R mysql-connector-odbc-8.0.32-linux-glibc2.28-x86-64bit/bin/ /usr/local/mysql
-
Under
\odbc\configdirectory, create the following files below:odbc.iniandodbcinst.ini.
You may use notepad editor or other preferred text editor to accomplish this.
-
Add the following entries below in
odbc.iniand save the file.
;
; odbc.ini configuration for Connector/ODBC 8.0 driver
;
[ODBC Data Sources]
myodbc8w = MyODBC 8.0 UNICODE Driver DSN
myodbc8a = MyODBC 8.0 ANSI Driver DSN
[myodbc8w]
Driver = /usr/local/mysql/lib/libmyodbc8w.so
Description = Connector/ODBC 8.0 UNICODE Driver DSN
SERVER =<REPLACE THIS WITH YOUR MYSQL SERVER NAME>
PORT = <REPLACE THIS WITH YOUR MYSQL PORT NUMBER. Default value is 3306>
USER =<REPLACE THIS WITH YOUR MYSQL USER NAME>
Password = <REPLACE THIS WITH YOUR MYSQL PASSWORD>
Database = <REPLACE THIS WITH YOUR MYSQL DATABASE NAME>
OPTION = 3
SOCKET =
SSLMODE = REQUIRED
CHARSET = utf8mb4
[myodbc8a]
Driver = /usr/local/mysql/lib/libmyodbc8a.so
Description = Connector/ODBC 8.0 ANSI Driver DSN
SERVER =<REPLACE THIS WITH YOUR MYSQL SERVER NAME>
PORT = <REPLACE THIS WITH YOUR MYSQL PORT NUMBER. Default value is 3306>
USER =<REPLACE THIS WITH YOUR MYSQL USER NAME>
Password = <REPLACE THIS WITH YOUR MYSQL PASSWORD>
Database = <REPLACE THIS WITH YOUR MYSQL DATABASE NAME>
OPTION = 3
SOCKET =
SSLMODE = REQUIRED
CHARSET = utf8mb4
-
Add the following entries below in
odbcinst.iniand save the file.
[MyODBC 8.0 UNICODE Driver DSN]
Description=Connector/ODBC 8.0 UNICODE Driver DSN
Driver=libmyodbc8w.so
Setup=libmyodbc8w.so
Debug=0
CommLog=1
UsageCount=2
[MyODBC 8.0 ANSI Driver DSN]
Description=Connector/ODBC 8.0 ANSI Driver DSN
Driver=libmyodbc8a.so
Setup=libmyodbc8a.so
Debug=0
CommLog=1
UsageCount=2
-
In your
docker-compose.ymlfile, ensure that following entries below are defined.
volumes:
-./config/odbc:/app/odbc-config
-
When provisioning new Redpoint Interaction client, use the myodbc8w as the data source name.
-
Restart the container.