一、Linux下安装unixODBC、freetds源码包:freetds-0.82.tar.gz、unixODBC-2.3.0.tar.gz1. 安装unixODBCgunzip unixODBC-2.3.t
一、Linux下安装unixODBC、freetds
源码包:freetds-0.82.tar.gz、unixODBC-2.3.0.tar.gz
1. 安装unixODBC
gunzip unixODBC-2.3.tar.gz
tar zxvf unixODBC-2.3.tar
./configure --prefix=/usr/local/unixODBC
make
make install
2. 安装freetds
tar zxvf freetds-0.82.tar.gz
cd freetds-0.82
./configure --prefix=/usr/local/freetds --with-unixodbc=/usr/local/unixODBC --with-tdsver=8.0
make
make install
cd /usr/local/unixODBC,向ODBC添加SQLServer驱动
# vi etc/odbcinst.ini
写入如下内容:
[ODBC]
Trace = Yes
TraceFile = /tmp/sql.log
ForceTrace = Yes
Pooling = No
[SQLSERVER]
Description = SQLSERVER
Driver = /usr/local/freetds/lib/libtdsodbc.so
Setup = /usr/local/freetds/lib/libtds.so
UsageCount = 1
CPTimeout = 5
CPReuse = 5
FileUsage = 1
添加DSN
# vi etc/odbc.ini
写入如下内容
[ejabberd]
Driver = SQLSERVER
Description = SQLSERVER
Server = 192.168.2.159
Database = ejabberd
Port = 1433
odbcinst.ini中的驱动名称,Database是数据库的名称
保存并退出。
测试ODBC的连接
# bin/isql -v ejabberd sa 111111
SQL>
SQL> quit
二、 ejabberd修改odbc文件
1. 安装ejabberd二进制包(略)
安装位置为/usr/local/ejabberd
2. 修改ejabberd的ODBC文件
进入/usr/local/ejabberd/conf目录
Vi odbc.ini
再次添加DSN信息:
[ejabberd]
Driver = SQLSERVER
Description = SQLSERVER
Server = 192.168.2.159
Database = ejabberd
Port = 1433
Vi odbcinst.ini
再次添加MSSQL的driver信息:
[ODBC]
Trace = Yes
TraceFile = /tmp/sql.log
ForceTrace = Yes
Pooling = No
[SQLSERVER]
Description = SQLSERVER
Driver = /usr/local/freetds/lib/libtdsodbc.so
Setup = /usr/local/freetds/lib/libtds.so
UsageCount = 1
CPTimeout = 5
CPReuse = 5
FileUsage = 1
注:用二进制安装的包,,Ejabberd包内置安装了一部分ODBC文件,但是包没有安装完全。
[root@ejabberd bin]# pwd
/usr/local/ejabberd/lib/odbc-2.10.3/priv/linux-x86/bin
[root@ejabberd bin]# ls
odbcserver
Ejabberd会调用此文件odbcserver,运行此文件会提示找不到libodbc.so.1
此时我们自己安装的unixODBC位于/usr/local/unixODBC下。
我们做一个软链接即可调用:
ln -s /usr/local/unixODBC/lib/libodbc.so.1 /usr/lib
三、 ejabberd修改配置文件
修改配置文件路径:/usr/local/ejabberd/conf/ejabberd.cfg
1. 验证修改
这个选项值的名字可能被误导, 因为 auth_method 名字用于通过ODBC以及通过原生MySQL接口访问关系数据库.
把{auth_method, internal}.注释掉。
{auth_method, [odbc]}.
2. 数据库连接
实际的数据库访问使用选项 odbc_server 来定义. 它的值通常用来定义我们是否想使用 ODBC, 或两个可用的原生接口之一。
{odbc_server, "DSN=ejabberd;UID=sa;PWD=111111"}.
3. 存储模块修改
以下几项,在原有基础上加上_odbc
mod_last_odbc、mod_offline_odbc、mod_privacy_odbc、mod_private_odbc、mod_pubsub_odbc、mod_roster_odbc、mod_vcard_odbc
mod_last_odbc: 最后连接日期和时间
mod_offline_odbc: 离线消息
mod_privacy_odbc: 用户黑名单规则
mod_private_odbc: 私有XML存储
mod_pubsub_odbc:发行-订阅
mod_roster_odbc:名册管理
mod_vcard_odbc:用户的VCARD
四、 MSSQL扩展架构
利用ejabberd-2.1.4.tar.gz源码包ODBC自带的mssql2005.sql文件,执行生成表和主键。
五、 其他配置
删除以前的数据库文件,进入/usr/local/ejabberd/database 目录,
删除ejabberd@localhost
新建一个管理员用户,首先./start启动ejabberd
ejabberdctl register admin ejabberd 111111 添加一个用户
将用户加入到管理员进行web管理
{acl, admin, {user, "admin", "ejabberd"}}.
{access, configure, [{allow, admin}]}.
注册用户正常可用。

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Notepad++7.3.1
Easy-to-use and free code editor
