当前位置: 技术问答>linux和unix
如何配置unixODBC
来源: 互联网 发布时间:2015-05-23
本文导语: 各位大侠帮我看看,下面的odbcinst.ini和odbc.ini配置对不对? 我用php连sql server出现如下问题 Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /va...
各位大侠帮我看看,下面的odbcinst.ini和odbc.ini配置对不对?
我用php连sql server出现如下问题
Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/test.php on line 9
Connect failed!
php的代码如下:
=========================================================
odbcinst.ini的配置如下
# Example driver definitinions
#
# Example driver definitinions
# Example driver definitinions
# Example driver definitinions
#
#
[ODBC Data Source]
SQLServer=SQL Server ODBC DRIVER
#[ODBC]
# Example driver definitinions
#
#
# Included in the unixODBC package
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/libodbcpsql.so
Setup = /usr/lib/libodbcpsqlS.so
FileUsage = 1
# From the MyODBC package
#[MySQL]
#Description = ODBC for MySQL
#Driver = /usr/lib/libmyodbc.so
#FileUsage = 1
# From the unxiODBC package
[SQLServer]
Description = ODBC for MS SQL Server
Driver = /usr/lib/libtdsS.so
FileUsage = 1
===================================================
odbc.ini的配置如下
# Example driver definitinions
#
#
[ODBC Data Source]
SQLServer=SQL Server ODBC DRIVER
#[ODBC]
#Trace=NO
#TraceFile=/home/db2v8i1/odbctrace.out
#InstallDir=/home/db2v8i1/
[DEFAULT]
Driver = SQLServer
# From the unxiODBC package
[SQLServer]
Description = ODBC for MS SQL Server
Driver = /usr/lib/libtdsS.so
FileUsage = 1
DRIVER = SQLServer
我用php连sql server出现如下问题
Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/test.php on line 9
Connect failed!
php的代码如下:
=========================================================
odbcinst.ini的配置如下
# Example driver definitinions
#
# Example driver definitinions
# Example driver definitinions
# Example driver definitinions
#
#
[ODBC Data Source]
SQLServer=SQL Server ODBC DRIVER
#[ODBC]
# Example driver definitinions
#
#
# Included in the unixODBC package
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/libodbcpsql.so
Setup = /usr/lib/libodbcpsqlS.so
FileUsage = 1
# From the MyODBC package
#[MySQL]
#Description = ODBC for MySQL
#Driver = /usr/lib/libmyodbc.so
#FileUsage = 1
# From the unxiODBC package
[SQLServer]
Description = ODBC for MS SQL Server
Driver = /usr/lib/libtdsS.so
FileUsage = 1
===================================================
odbc.ini的配置如下
# Example driver definitinions
#
#
[ODBC Data Source]
SQLServer=SQL Server ODBC DRIVER
#[ODBC]
#Trace=NO
#TraceFile=/home/db2v8i1/odbctrace.out
#InstallDir=/home/db2v8i1/
[DEFAULT]
Driver = SQLServer
# From the unxiODBC package
[SQLServer]
Description = ODBC for MS SQL Server
Driver = /usr/lib/libtdsS.so
FileUsage = 1
DRIVER = SQLServer
|
装一个SYBASE客户端
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。