首页 > 后端开发 > php教程 > mac配置impala odbc

mac配置impala odbc

WBOY
发布: 2016-07-29 09:02:50
原创
1442 人浏览过

下载mac对应驱动并安装:http://www.cloudera.com/downloads.html.html

*HOST 地址是impala Daemon所在的机器ip,端口可以在cm中设置
vi /usr/local/Cellar/unixodbc/2.3.2_1/etc/odbc.ini

<code><span>[ODBC Data Sources]</span><span>Sample_Cloudera_Impala_DSN_64=<span>Cloudera Impala ODBC Driver <span>64</span>-bit</span></span><span>[Sample_Cloudera_Impala_DSN_64]</span><span>Driver=<span>/opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib</span></span><span>HOST=<span><span>192.168</span>.<span>2.103</span></span></span><span>PORT=<span><span>21050</span></span></span></code>
登录后复制

vi /usr/local/Cellar/unixodbc/2.3.2_1/etc/odbcinst.ini

<code>[<span>ODBC</span><span>Drivers</span>]
<span>Cloudera</span><span>Impala</span><span>ODBC</span><span>Driver</span><span>64</span>-bit=<span>Installed</span>[<span>Cloudera</span><span>Impala</span><span>ODBC</span><span>Driver</span><span>64</span>-bit]
<span>Description</span>=<span>Cloudera</span><span>Impala</span><span>ODBC</span><span>Driver</span> (<span>64</span>-bit)
<span>Driver</span>=<span>/opt/cloudera</span><span>/impalaodbc/lib</span><span>/universal/libclouderaimpalaodbc</span>.dylib</code>
登录后复制

测试:
isql -v Sample_Cloudera_Impala_DSN_64

PHP连接:

<code><span><span><?php </span><span>$connection</span>=odbc_connect(<span>'Sample_Cloudera_Impala_DSN_64'</span>,<span>''</span>,<span>''</span>);
<span>$SQL_Exec_String</span>=<span>"show tables"</span>;
<span>$result</span>=odbc_exec(<span>$connection</span>, <span>$SQL_Exec_String</span>);
<span>while</span>(odbc_fetch_row(<span>$result</span>))
{
<span>$Tables</span>=odbc_result(<span>$result</span>, <span>1</span>);
<span>echo</span><span>$Tables</span>.<span>'<br>'</span>;
}
<span>?></span></span></span></code>
登录后复制
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了mac配置impala odbc,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板