mac配置impala odbc

WBOY
Lepaskan: 2016-07-29 09:02:50
asal
1441 orang telah melayarinya

下载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>
Salin selepas log masuk

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>
Salin selepas log masuk

测试:
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>
Salin selepas log masuk
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

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

Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan