ubuntu16.04 freeswitch1.6使用odbc

1、安装MySQL

apt-get install mysql-server  mysql-client

修改配置,监听所有

vim /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address            =0.0.0.0

重启

 /etc/init.d/mysql restart

建立数据库

# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.19-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2017, 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> CREATE USER 'freeswitch'@'%' IDENTIFIED BY '123456'; 
Query OK, 0 rows affected (0.00 sec)

mysql> create database sofia_internal;
Query OK, 1 row affected (0.00 sec)

mysql> create database freeswitch;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on sofia_internal.* to 'freeswitch'@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on freeswitch.* to 'freeswitch'@'%';
Query OK, 0 rows affected (0.00 sec)

mysql>

2、安装ODBC

apt-get install unixodbc-dev

下载mysql的ubuntu odbc驱动
https://dev.mysql.com/downloads/connector/odbc/

解压后,拷贝lib里面的.so到/usr/lib/x86_64-linux-gnu/odbc/
在解压的bin里面,执行

 ./myodbc-installer -d -a -n "MySQL ODBC 5.3 Unicode Driver"  -t "DRIVER=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5w.so;SETUP=/usr/lib/x86_64-linux-gnu/odbc/myodbc5S.so"
./myodbc-installer -d -a -n "MySQL ODBC 5.3 ANSI Driver"  -t "DRIVER=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5a.so;SETUP=/usr/lib/x86_64-linux-gnu/odbc/lmyodbc5S.so"

或直接在/etc/odbcinst.ini增加

[MySQL ODBC 5.3 Unicode Driver]
Driver=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5w.so
SETUP=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5S.so
UsageCount=1

[MySQL ODBC 5.3 ANSI Driver]
Driver=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5a.so
SETUP=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5S.so
UsageCount=1

您的支持,是我持续创作的动力!!!!
在这里插入图片描述

3、配置ODBC
vi /etc/odbc.ini加入

[freeswitch]
Driver          = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc5w.so
DATABASE        = freeswitch
DESCRIPTION     = freeswitch core
SERVER          = 127.0.0.1
UID             = freeswitch
PASSWORD        = 123456
PORT            = 3306
SOCKET          =


[sofia_internal]
Driver          =/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5w.so
DATABASE        = sofia_internal
DESCRIPTION     = sofia internal
SERVER          = 127.0.0.1
UID             = freeswitch
PASSWORD        = 123456
PORT            = 3306
SOCKET          =

  1.  测试连接
    
isql -v freeswitch

6、指定数据库连接
修改conf\autoload_configs\switch.conf 中的core-db-dsn

<param name="core-db-dsn" value="odbc://freeswitch:freeswitch:123456"/>

conf/sip_profiles/internal.xml中

<param name="odbc-dsn" value="odbc://sofia_internal:freeswitch:123456"/>

说明:odbc://连接方式
freeswitch:数据库名
freeswitch:用户名
123456:密码

您的支持,是我持续创作的动力!!!!
在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值