Freeswitch安装ODBC环境

2020-04-15

Freeswitch安装ODBC环境

环境

debian 9 

​ Freeswitch 1.8.7

​ mariadb

目的: 用于freeswitch链接数据库服务

下载并安装

1
sudo apt install unixodbc
1
2
3
4
5
cd /usr/src &&
wget https://dev.mysql.com/get/Downloads/Connector-ODBC/5.3/mysql-connector-odbc-5.3.10-linux-debian8-x86-64bit.tar.gz &&
tar zxvf mysql-connector-odbc-5.3.10-linux-debian8-x86-64bit.tar.gz &&
cd mysql-connector-odbc-5.3.10-linux-debian8-x86-64bit/lib &&
cp libmyodbc5* /usr/lib/x86_64-linux-gnu/odbc/

配置

1
2
3
4
5
6
7
cat >> /etc/odbcinst.ini << EOF
[MySQL]
Driver=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5w.so
UsageCount = 1
FileUsage = 1
Threading = 0
EOF
1
2
3
4
5
6
cat >> /etc/odbcinst.ini << EOF
[MySQL]
Driver=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5w.so
UsageCount=2

EOF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
cat >> /etc/odbc.ini << EOF
[freeswitch]
Description=MySQL connection to 'freeswitch' database
driver=MySQL
server=localhost
database=freeswitch
username=fs
password=freeswitch
Port=3306
OPTION = 67108864
Socket=/var/run/mysqld/mysqld.sock
option=3

EOF

SQL数据库创建

(这里数据库账号fs密码freeswitch只是测试使用)

1
2
3
4
create database freeswitch;
grant all privileges on freeswitch.* to fs@localhost identified by 'freeswitch';
flush privileges;
use freeswitch;

编译freeswitch加上

1
./configure --enable-core-odbc-support

测试

1
isql -v freeswitch