KOI8-R

Kirill Lopuchov, lopuchov at mail ru

    SQL-       . 3proxy     ODBC-    ,  ODBC-.     -   Windows, ,  ,    Unix.       FreeBSD      SQLite.         ,         (         mysql   postgresql     odbc-)
 
  SQLite
wget http://www.sqlite.org/sqlite-2.8.14.tar.gz
tar -xvzf sqlite-2.8.14.tar.gz
cd sqlite 
./configure
gmake 
gmake install

  iODBC 
wget http://www.iodbc.org/libiodbc-3.51.2.tar.gz
tar -xvzf libiodbc-3.51.2.tar.gz
cd libiodbc-3.51.2
./configure --disable-gui --disable-gtktest
make 
make install

  odbc  SQLite
wget http://www.ch-werner.de/sqliteodbc/sqliteodbc-0.62.tar.gz
tar -xvzf sqliteodbc-0.62.tar.gz
cd sqliteodbc-0.62

./configure
     configure   : 
 (configure: error: SQLite library too old)
     ,  (SQLITE_COMPILE=1
  . 5092   if endif)   configure
make 
make install


     iODBC  
 /etc/odbcinst.ini  /etc/odbc.ini

 odbc  
--------------/etc/odbcinst.ini-------------
[ODBC Drivers]
SQLite=Installed

[SQLite]
Driver=/usr/local/lib/libsqliteodbc.so
---------------------------------------

 DSN   c  "sqlite",   
  : /usr/local/3proxy/logs.db

--------------/etc/odbc.ini----------------
[ODBC Data Sources]
sqlite=SQLite

[sqlite]
Driver=/usr/local/lib/libsqliteodbc.so
Description=SQLite test database
Database=/usr/local/3proxy/logs.db
# optional lock timeout in milliseconds
Timeout=2000
---------------------------------------

        (logformat 
.   3proxy.cfg.sample )

sqlite /usr/local/3proxy/logs.db

SQLite version 2.8.14
Enter ".help" for instructions
sqlite>create table log (
   ...> l_date char (11), 
   ...> l_chour char (10), 
   ...> l_user char (30), 
   ...> l_service char (30), 
   ...> l_in  integer, 
   ...> l_out integer, 
   ...> l_descr char  (64000), 
   ...>);


      3proxy.cfg
---------------3proxy.cfg-----------------   
log &sqlite

logformat "Linsert into log ( l_date, l_chour, l_user, l_service, l_in, l_out, 
l_descr)
values ('%d-%m-%Y', '%H:%M:%S', '%U', '%N', %I, %O, '%T')"
------------------------------------------

C 3proxy c  iODBC,    Makefile.unix 
 
CFLAGS = -Wall -O2 -c -pthread -D_THREAD_SAFE -D_REENTRANT -DWITH_STD_MALLOC -I/usr/local/include
LIBS = -L /usr/local/lib -lodbc

  

make clean
make -f Makefile.unix

