遇到的问题----DBI的ODBC报错运行perl脚本时报错:[unixODBC][Driver Manager]Data source name not found, and no default
2013-12-16 14:54
966 查看
我查看了 /usr/local/unixODBC下的 etc/odbc.ini里面是有配置记录的
而且 用[root@localhost unixODBC]# bin/isql -v zzq_gy_tm_local sa kkzzz1112332442557788
来测试也可以成功连上 但是就是perl脚本运行时报错
今天,在使用unixODBC连接mysql数据库时,使用isql测试报如上错误信息:
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect
找了半天,终于发现问题,原来是环境变量未正确配置,系统找不到配置文件。本来之前是正确的,后来我修改了unixODBC的目录名称,导致找不到了,通过执行odbcinst -j命令可以查看当前配置信息情况,以确认相关配置信息的路径是否正确。重新配置ODBCINI及ODBCSYSINI两个环境变量即可。
其中,ODBCINI设置为odbc.ini的文件路径全名,ODBCSYSINI配置为配置文件路径,如下:
export ODBCINI=/unixODBC/etc/odbc.ini (具体路径根据自己的安装目录对应 我的如下图)
export ODBCSYSINI=/unixODBC/etc
一切OK。
而且 用[root@localhost unixODBC]# bin/isql -v zzq_gy_tm_local sa kkzzz1112332442557788
来测试也可以成功连上 但是就是perl脚本运行时报错
今天,在使用unixODBC连接mysql数据库时,使用isql测试报如上错误信息:
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect
找了半天,终于发现问题,原来是环境变量未正确配置,系统找不到配置文件。本来之前是正确的,后来我修改了unixODBC的目录名称,导致找不到了,通过执行odbcinst -j命令可以查看当前配置信息情况,以确认相关配置信息的路径是否正确。重新配置ODBCINI及ODBCSYSINI两个环境变量即可。
其中,ODBCINI设置为odbc.ini的文件路径全名,ODBCSYSINI配置为配置文件路径,如下:
export ODBCINI=/unixODBC/etc/odbc.ini (具体路径根据自己的安装目录对应 我的如下图)
export ODBCSYSINI=/unixODBC/etc
一切OK。
相关文章推荐
- 遇到的问题----DBI的ODBC报错运行perl脚本时报错:[unixODBC][Driver Manager]Data source name not found, and no default
- 有关unixODBC:Data source name not found, and no default driver specified的问题
- isql [IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
- [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
- 使用Struts2遇到There is no action mapped for namespaces / and action name的问题
- 《Appium学习中遇到的问题》之“运行脚本时报错:Activity used to start app doesn't exist or cannot be launched!”
- 新手学习Struts2遇到的问题:There is no Action mapped for namespace / and action name . - [unknown location]
- 我遇到的问题: There is no Action mapped for namespace [/] and action name
- cocos2dx 编译 plugin-x 遇到的问题_tkinter.TclError: no display name and no $DISPLAY environment variable
- 遇到的问题-----------perl脚本用handlersocket把数据插入mysql执行时报错lock_tables
- 遇到的问题-----------perl脚本用handlersocket把数据插入mysql执行时报错lock_tables
- perl的dbi数据访问odbc读取sqlserver数据被截断的问题
- There is no Action mapped for namespace / and action name ..问题分析
- php使用odbc执行复杂函数遇到的问题,sql语句直接在sqlserver数据库中运行有结果,使用php总是为空
- perl的dbi数据访问odbc读取sqlserver数据被截断的问题
- There is no Action mapped for namespace / and action name ..问题分析
- 部署Struts遇到“There is no Action mapped for namespace [/] and action name [...] associated with .."问题
- Mysql运行脚本时出现问题:Failed to open file 'file_name' , error: 2
- 关于这个问题There is no Action mapped for namespace / and action name login.的处理
- SSH + Oracle 整合问题之六 There is no Action mapped for namespace / and action name open.