User Tools

Site Tools


wiki:voip:asterisk:odbc

Instalace ODBC

root@server:~# apt-get install unixodbc libmyodbc odbcinst1debian2 unixODBC unixODBC-dev

Zkontrolujeme zda existují tyto soubory:

  • /etc/odbc.ini
  • /etc/odbcinst.ini

Pokud ne, tak je vytvoříme:

root@server:~# touch /etc/odbcinst.ini
root@server:~# touch /etc/odbc.ini
root@server:~# ls /usr/lib/odbc/
#(nebo ls /usr/lib/x86_64-linux-gnu/odbc/)
#(nebo /usr/lib/i386-linux-gnu/odbc/)

libesoobS.so  libmyodbc.so  libodbcdrvcfg1S.so	libodbcminiS.so  libodbcnnS.so	  libodbctxtS.so  liboraodbcS.so  libtdsS.so
libmimerS.so  libnn.so	    libodbcdrvcfg2S.so	libodbcmyS.so	 libodbcpsqlS.so  liboplodbcS.so  libsapdbS.so
root@server:~# mkdir /root/odbc
root@server:~# nano odbc/mysql
/root/odbc/mysql
[MySQL]
Description     = MySQL driver for Linux & Win32
Driver          = /usr/lib/odbc/libmyodbc.so
Setup           = /usr/lib/odbc/libodbcmyS.so
FileUsage       = 1
root@server:~# odbcinst -i -d -f odbc/mysql
root@server:~# odbcinst -i -d -f odbc/mysql 
odbcinst: Driver installed. Usage count increased to 1. 
    Target directory is /etc
root@server:~# nano /etc/odbc.ini
/etc/odbc.ini
[asterisk]
Description = MySQL Asterisk
Driver      = MySQL
SERVER      = localhost
USER        = username
PASSWORD    = password
PORT        = 3306
DATABASE    = asterisk
Option      = 3
root@server:~# isql asterisk
root@server:~# isql asterisk
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> 
wiki/voip/asterisk/odbc.txt · Last modified: 2014/12/26 18:31 (external edit)