Apache Ignite-[PDOException] SQLSTATE [IM002] SQLConnect:0 [unixODBC] [驱动程序管理器]找不到数据源名称,并且未指定默认驱动程序 [英] Apache Ignite - [PDOException] SQLSTATE[IM002] SQLConnect: 0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified

查看:385
本文介绍了Apache Ignite-[PDOException] SQLSTATE [IM002] SQLConnect:0 [unixODBC] [驱动程序管理器]找不到数据源名称,并且未指定默认驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了apache ignite,从Java应用程序将数据加载到ignite中,并且可以使用rest api进行查询.我需要从PHP查询它

I have setup apache ignite, loaded data into ignite from Java app and can query using rest apis. I need to query it from PHP so

我正在尝试使用pdo_odbc从PHP连接到Apache Ignite.我有

I am trying to connect to Apache Ignite from PHP using pdo_odbc. I have,

i)已安装的ODBC驱动程序管理器- http://www.unixodbc.org/

i) Installed ODBC driver manager - http://www.unixodbc.org/

ii)内置ODBC驱动程序 http://apacheignite. gridgain.org/docs/odbc-driver#section-building-on-linux

ii) Built ODBC driver http://apacheignite.gridgain.org/docs/odbc-driver#section-building-on-linux

iii)安装了Ignite ODBC驱动程序 http://apacheignite .gridgain.org/docs/odbc-driver#section-installing-on-linux

iii) installed Ignite ODBC driver http://apacheignite.gridgain.org/docs/odbc-driver#section-installing-on-linux,

iv)配置了dsn, http://apacheignite. gridgain.org/v1.8/docs/connecting-string#configuring-dsn 使用

iv) configured dsn, http://apacheignite.gridgain.org/v1.8/docs/connecting-string#configuring-dsn using

odbcinst -j

odbcinst -j

unixODBC 2.3.4
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/me/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

猫/etc/odbcinst.ini

cat /etc/odbcinst.ini

[Apache Ignite]
Description=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
UsageCount=1

cat/etc/odbc.ini

cat /etc/odbc.ini

[Apache Ignite]
Description=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
UsageCount=1

猫/home/me/.odbc.ini

cat /home/me/.odbc.ini

[Apache Ignite]
Description=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
UsageCount=1

v)安装了pdo_odbc,

v) installed pdo_odbc,

sudo apt install php5.6-odbc

它显示在phpinfo中.

It shows in phpinfo.

vi)使用

Ignite ignite = Ignition.start("examples/config/example-ignite.xml");
IgniteConfiguration iCfg = ignite.configuration();
OdbcConfiguration odbcCfg = new OdbcConfiguration();
iCfg.setOdbcConfiguration(odbcCfg);

vii)

$ignite = $dbh = new \PDO('odbc:Apache Ignite');
$ignite->prepare('select * from Person');

我仍然遇到这种情况.

  [PDOException]                                                                                                              
  SQLSTATE[01000] SQLConnect: 0 [unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libignite-odbc.so' : file not found 

更新:LD_LIBRARY_PATH已经具有/usr/local/lib ls/usr/local/lib | grep libignite-binary-1.8.0.16166.so.0

Update: LD_LIBRARY_PATH already has /usr/local/lib ls /usr/local/lib | grep libignite-binary-1.8.0.16166.so.0

libignite-binary-1.8.0.16166.so.0
libignite-binary-1.8.0.16166.so.0.0.0

ldd/usr/local/lib/libignite-odbc.so

ldd /usr/local/lib/libignite-odbc.so

linux-vdso.so.1 =>(0x00007ffe68521000) libignite-binary-1.8.0.16166.so.0 =>找不到

linux-vdso.so.1 => (0x00007ffe68521000) libignite-binary-1.8.0.16166.so.0 => not found

推荐答案

您是否尝试过运行ldd /usr/local/lib/libignite-odbc.so?似乎有一些未解决的依赖项.也许您需要将它们添加到LD_LIBRARY_PATH.

Have you tried run ldd /usr/local/lib/libignite-odbc.so? It seems like there are some unresolved dependencies. Maybe you need to add them to LD_LIBRARY_PATH.

这篇关于Apache Ignite-[PDOException] SQLSTATE [IM002] SQLConnect:0 [unixODBC] [驱动程序管理器]找不到数据源名称,并且未指定默认驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆