forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
317 lines
52 KiB
HTML
317 lines
52 KiB
HTML
<a name="EN-US_TOPIC_0000001233563107"></a><a name="EN-US_TOPIC_0000001233563107"></a>
|
|
|
|
<h1 class="topictitle1">Configuring a Data Source in the Linux OS</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001233563107__en-us_topic_0059778464_p445652912200">The ODBC DRIVER (psqlodbcw.so) provided by <span id="EN-US_TOPIC_0000001233563107__text1781137857">GaussDB(DWS)</span> can be used after it has been configured in the data source. To configure data sources, users must configure the <strong id="EN-US_TOPIC_0000001233563107__b58128632153257">odbc.ini</strong> and <strong id="EN-US_TOPIC_0000001233563107__b53395641153257">odbcinst.ini</strong> files on the server. The two files are generated during the unixODBC compilation and installation, and are saved in the <strong id="EN-US_TOPIC_0000001233563107__b49418201393924">/usr/local/etc</strong> directory by default.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001233563107__sc6acab38f2514630b494c3ad3d36951c"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0000001233563107__of8392d967d124699836ac5550c5cef75"><li id="EN-US_TOPIC_0000001233563107__l81ef62e7737343f281bf40267fd85705"><span>Obtain the source code package of unixODBC at: Currently, unixODBC-2.2.1 is not supported. unixODBC-2.3.0 is used as an example.</span><p><p id="EN-US_TOPIC_0000001233563107__aef9a4c677c7945b9b46b68fc068b19f7"><a href="https://sourceforge.net/projects/unixodbc/files/unixODBC/2.3.0/unixODBC-2.3.0.tar.gz/download" target="_blank" rel="noopener noreferrer">https://sourceforge.net/projects/unixodbc/files/unixODBC/2.3.0/unixODBC-2.3.0.tar.gz/download</a></p>
|
|
</p></li><li id="EN-US_TOPIC_0000001233563107__li10789205223216"><span>Prepare <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b842352706145016">unixODBC</strong>.</span><p><ol type="a" id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_ol51532133185452"><li id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_li56389105185454">Decompress the <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b2006741919145033">unixODBC</strong> code file.<pre class="screen" id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_screen111870954315">tar -xvf unixODBC-2.3.0.tar.gz</pre>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_li15236967185652">Compile the code file and install the driver.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_screen1938411464456"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">cd</span><span class="w"> </span><span class="n">unixODBC</span><span class="o">-</span><span class="mi">2</span><span class="p">.</span><span class="mi">3</span><span class="p">.</span><span class="mi">0</span>
|
|
<span class="p">.</span><span class="o">/</span><span class="n">configure</span><span class="w"> </span><span class="c1">--enable-gui=no</span>
|
|
<span class="n">make</span>
|
|
<span class="n">make</span><span class="w"> </span><span class="n">install</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_note69312159488"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_ul12637252506"><li id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_li4637145155010">After the unixODBC is compiled and installed, the <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b7209704995506">*.so.2</strong> library file will be in the installation directory. To create the <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b13026444995506">*.so.1</strong> library file, change <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b8806063805506">LIB_VERSION</strong> in the configure file to <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b6338722775506">1:0:0</strong>.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_screen134015019565"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">LIB_VERSION</span><span class="o">=</span><span class="ss">"1:0:0"</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_li58222049131515">This driver dynamically loads the <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b13880614775506">libodbcinst.so.</strong>* library files. If one of the library files is successfully loaded, the library file is loaded. The loading priority is <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b6803856465506">libodbcinst.so</strong> > <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b13012220405506">libodbcinst.so.1</strong> > <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b15569922205506">libodbcinst.so.1.0.0</strong> > <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b17179838055506">libodbcinst.so.2</strong> > <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b5504092675506">libodbcinst.so.2.0.0</strong>.<p id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_p6296185810152">For example, a directory can be dynamically linked to <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b16251353505506">libodbcinst.so.1</strong>, <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b11561235935506">libodbcinst.so.1.0.0</strong>, and <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b12866822635506">libodbcinst.so.2</strong>. The driver file loads <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b421781025506">libodbcinst.so</strong> first. If <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b5860882185506">libodbcinst.so</strong> cannot be found in the current environment, the driver file searches for <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b17134210995506">libodbcinst.so.1</strong>, which has a lower priority. After <strong id="EN-US_TOPIC_0000001233563107__en-us_topic_0000001422959309_b20465910145506">libodbcinst.so.1</strong> is loaded, the loading is complete.</p>
|
|
</li></ul>
|
|
</div></div>
|
|
</li></ol>
|
|
</p></li><li id="EN-US_TOPIC_0000001233563107__li75024335317"><span>Replace the <span id="EN-US_TOPIC_0000001233563107__text165019434537">GaussDB(DWS)</span> client driver.</span><p><p id="EN-US_TOPIC_0000001233563107__p231910534212">Decompress <strong id="EN-US_TOPIC_0000001233563107__b384874619243">dws_8.1.</strong><em id="EN-US_TOPIC_0000001233563107__i5855114692413">x</em><strong id="EN-US_TOPIC_0000001233563107__b8855194618249">_odbc_driver_for_</strong><em id="EN-US_TOPIC_0000001233563107__i15856124614245">xxx</em><strong id="EN-US_TOPIC_0000001233563107__b1485694616243">_</strong><em id="EN-US_TOPIC_0000001233563107__i16856154652412">xxx</em><strong id="EN-US_TOPIC_0000001233563107__b785754662417">.zip</strong> to obtain the <strong id="EN-US_TOPIC_0000001233563107__b18857134662419">psqlodbcw.la</strong> and <strong id="EN-US_TOPIC_0000001233563107__b385724611248">psqlodbcw.so</strong> files in the <strong id="EN-US_TOPIC_0000001233563107__b16858164611241">/dws_8.1.</strong><em id="EN-US_TOPIC_0000001233563107__i128581546182420">x</em><strong id="EN-US_TOPIC_0000001233563107__b1585914632417">_odbc_driver_for_</strong><em id="EN-US_TOPIC_0000001233563107__i1285916461249">xxx</em><strong id="EN-US_TOPIC_0000001233563107__b178591546122414">_</strong><em id="EN-US_TOPIC_0000001233563107__i786094617248">xxx</em><strong id="EN-US_TOPIC_0000001233563107__b286044602411">/odbc/lib</strong> directory.</p>
|
|
</p></li><li id="EN-US_TOPIC_0000001233563107__l9916f0b095ce48aeb2e6ff14ac8ce8dd"><span>Configure the data source.</span><p><ol type="a" id="EN-US_TOPIC_0000001233563107__o83a2ae3c708347a08ad58a7b0863647d"><li id="EN-US_TOPIC_0000001233563107__l493c13d5e3974612818309f5d3670a5c">Configure the ODBC driver file.<p id="EN-US_TOPIC_0000001233563107__a77b36efe0b54406a9b4e087729043f26"><a name="EN-US_TOPIC_0000001233563107__l493c13d5e3974612818309f5d3670a5c"></a><a name="l493c13d5e3974612818309f5d3670a5c"></a>Add the following content to the end of the <strong id="EN-US_TOPIC_0000001233563107__b842352706203139">/usr/local/etc/odbcinst.ini</strong> file:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001233563107__saffeaee6ac6d40dd8e5d12bf3dbd7d20">[GaussMPP]
|
|
Driver64=/usr/local/lib/psqlodbcw.so
|
|
setup=/usr/local/lib/psqlodbcw.so</pre>
|
|
<p id="EN-US_TOPIC_0000001233563107__a29ca0872c82d421cbbfb8aae2e9ee547">For descriptions of the parameters in the <strong id="EN-US_TOPIC_0000001233563107__b1341344035915">odbcinst.ini</strong> file, see <a href="#EN-US_TOPIC_0000001233563107__taf2925d5217b456dab21acdd246a6218">Table 1</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001233563107__taf2925d5217b456dab21acdd246a6218"></a><a name="taf2925d5217b456dab21acdd246a6218"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233563107__taf2925d5217b456dab21acdd246a6218" frame="border" border="1" rules="all"><caption><b>Table 1 </b>odbcinst.ini configuration parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233563107__r873e7bbcfa7a45d5a91f188f59d4db97"><th align="left" class="cellrowborder" valign="top" width="26.340000000000003%" id="mcps1.3.2.2.4.2.1.1.4.2.4.1.1"><p id="EN-US_TOPIC_0000001233563107__a19b8525bd8a744a5ab5a70944bff515f">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="38.89%" id="mcps1.3.2.2.4.2.1.1.4.2.4.1.2"><p id="EN-US_TOPIC_0000001233563107__a5092f2ffa7474e18ae2c2b8d511cc2a2">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="34.77%" id="mcps1.3.2.2.4.2.1.1.4.2.4.1.3"><p id="EN-US_TOPIC_0000001233563107__afa89325ab8864c35b5b5d36adbe07ff1"><strong id="EN-US_TOPIC_0000001233563107__b84235270621571">Example</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001233563107__r7aabbf635ded41b193443d7cde3c08a1"><td class="cellrowborder" valign="top" width="26.340000000000003%" headers="mcps1.3.2.2.4.2.1.1.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__a6a124fe2dbb343f8a46c44124e00f0b8">[DriverName]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.89%" headers="mcps1.3.2.2.4.2.1.1.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a09c5c094efd449f4889d9c79f9f2f1ac">Driver name, corresponding to Driver in DSN.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.77%" headers="mcps1.3.2.2.4.2.1.1.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a3abcd54580b44647a34f58ac17824de6">[DRIVER_N]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__rf4a171ecb64f4859a357a0a1b67fe625"><td class="cellrowborder" valign="top" width="26.340000000000003%" headers="mcps1.3.2.2.4.2.1.1.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__a98f5095961b344eb8006a9a8a41b1e4c">Driver64</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.89%" headers="mcps1.3.2.2.4.2.1.1.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a269fb5b5f6484a0cba727f1faa210031">Path of the dynamic driver library</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.77%" headers="mcps1.3.2.2.4.2.1.1.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a0a2b7c3242c54cbdb4481ba849ab7336">Driver64=/xxx/odbc/lib/psqlodbcw.so</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__r6c7121a7af9148899c9c710b57c4cfd3"><td class="cellrowborder" valign="top" width="26.340000000000003%" headers="mcps1.3.2.2.4.2.1.1.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__a13345f2e81b34168ae318ab7d705f28e">setup</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="38.89%" headers="mcps1.3.2.2.4.2.1.1.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__af4f160c9631c426480235ad33a6cd8d9">Driver installation path, which is the same as the dynamic library path in Driver64.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.77%" headers="mcps1.3.2.2.4.2.1.1.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a50002409d23d4588bd402e16d8107d7a">setup=/xxx/odbc/lib/psqlodbcw.so</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__l1840b52806e74147b7550417c7f67970">Configure the data source file.<p id="EN-US_TOPIC_0000001233563107__a52cbbe865cda4f8ebd00ddbeab54c0f0"><a name="EN-US_TOPIC_0000001233563107__l1840b52806e74147b7550417c7f67970"></a><a name="l1840b52806e74147b7550417c7f67970"></a>Add the following content to the end of the <strong id="EN-US_TOPIC_0000001233563107__b26771535153257">/usr/local/etc/odbc.ini</strong> file:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001233563107__s70ca578249b549a7b73c0ea957e07d94">[MPPODBC]
|
|
Driver=GaussMPP
|
|
Servername=<strong id="EN-US_TOPIC_0000001233563107__b202311206420">10.10.0.13</strong> (database server IP address)
|
|
Database=<strong id="EN-US_TOPIC_0000001233563107__b13391183118316"><span id="EN-US_TOPIC_0000001233563107__text91831321465">gaussdb</span></strong> (database name)
|
|
Username=<strong id="EN-US_TOPIC_0000001233563107__b12384351935"><span id="EN-US_TOPIC_0000001233563107__text1746816106572">dbadmin</span></strong> (database username)
|
|
Password= (database user password)
|
|
Port=<strong id="EN-US_TOPIC_0000001233563107__b747234542"><span id="EN-US_TOPIC_0000001233563107__text14943162320574">8000</span></strong> (database listening port)
|
|
Sslmode=allow</pre>
|
|
<p id="EN-US_TOPIC_0000001233563107__abd63eb427ec84964b6559258d8b73003">For descriptions of the parameters in the <strong id="EN-US_TOPIC_0000001233563107__b61991212019">odbc.ini</strong> file, see <a href="#EN-US_TOPIC_0000001233563107__t9b0fd675e5df4f31873fd95186e7fe93">Table 2</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001233563107__t9b0fd675e5df4f31873fd95186e7fe93"></a><a name="t9b0fd675e5df4f31873fd95186e7fe93"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233563107__t9b0fd675e5df4f31873fd95186e7fe93" frame="border" border="1" rules="all"><caption><b>Table 2 </b>odbc.ini configuration parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233563107__raa460ebe747a4087bfcb51a357bf91d6"><th align="left" class="cellrowborder" valign="top" width="25.96%" id="mcps1.3.2.2.4.2.1.2.4.2.4.1.1"><p id="EN-US_TOPIC_0000001233563107__ac48f42965b3d4da08f3c74ac2d5fa6e9">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="39.4%" id="mcps1.3.2.2.4.2.1.2.4.2.4.1.2"><p id="EN-US_TOPIC_0000001233563107__a89f5ea4d8e5248888bcc6defa39415e9">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="34.64%" id="mcps1.3.2.2.4.2.1.2.4.2.4.1.3"><p id="EN-US_TOPIC_0000001233563107__abdc84ef90c944ce09ca92f27ce3218c3"><strong id="EN-US_TOPIC_0000001233563107__b48322977">Example</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001233563107__re7715e101d5248008c6f741f80762878"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__a989a4f38b8e549a799096cf89231773f">[DSN]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a4006129610d547cc863a9963dacba94d">Data source name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__ae9dbc86f0788406ba2ea04955210bf42">[MPPODBC]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__r163544ad04fa4440a95849c69908b268"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__a2fc45aecab9544588e9c05afd422e484">Driver</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a1d2e9cf4422445bc9cf33707ca8ab3a2">Driver name, corresponding to DriverName in <strong id="EN-US_TOPIC_0000001233563107__b51821261153257">odbcinst.ini</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a06bd420170254aa58da6376d07a8624b">Driver=DRIVER_N</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__rcaffcff83c65477982f30ce20de5f910"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__aeeedca16b79f44fa857a8e374224e781">Servername</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a68e25a774678466289323fddf976db50">IP address of the server</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__af229b4a5bcb84be9845838b7576386d9">Servername=10.145.130.26</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__rc26be11873464403810eebd3480485f5"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__a4db874a8d5c64961aee6fc6f9383c03f">Database</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a917c185973e24086a537b3afc8875946">Name of the database to connect to</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__af8011dbe8cb54d3e9fa74cebce828475">Database=<span id="EN-US_TOPIC_0000001233563107__text378783924015">gaussdb</span></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__rdee4148dc69649978249d003db58b1e1"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__a4c6fa84255ed4f6383967fc2e843177e">Username</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a15f081451d5a49c7b437dce8db5d6ad9">Name of the database user</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a661cb895b4da499d94878f28f7a62e77">Username=<span id="EN-US_TOPIC_0000001233563107__text844218157119">dbadmin</span></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__ra841a52f9bae413091e4e6902147a82d"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__af45ef0204bff4446a0d767c5d7f9bdbf">Password</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a849f11380ebb4169933d76afdf09c685">Password of the database user</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a682b421c90a3486281a75ff2fdea76cd">Password=</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001233563107__nc41d2296fbaf43e0a6176f20134ec40c"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0000001233563107__aee1fcd49777249d59341e55dcf417708">After a user established a connection, the ODBC driver automatically clears their password stored in memory.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__a6928b76ebfa4455d923cc438ed4b6bf9">However, if this parameter is configured, UnixODBC will cache data source files, which may cause the password to be stored in the memory for a long time.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__a21ec3f09aadd4cdf8414912f6f59668f">When you connect to an application, you are advised to send your password through an API instead of writing it in a data source configuration file. After the connection has been established, immediately clear the memory segment where your password is stored.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__r6dbddb1dafce45f189ed37db3f444c26"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__ae2d995165eaf45ed93953e0fee313036">Port</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a94eda1395785400387112f0e29ec49a9">Port ID of the server</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a7f2925bfb3ce45c89ebc5420aedf2361">Port=<span id="EN-US_TOPIC_0000001233563107__text123740515111">8000</span></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__rd9fcd2e9e8e441b2a14cab17c8ef8b32"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__aabc2f39d4fb84d8eaad3dc2bf202ed03">Sslmode</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__ad403c925c6974ffa86c02305171f0edc">Whether to enable the SSL mode</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a7db0f1e9e1fb4cd788e063d74277ccf5">Sslmode=allow</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__row3180734193610"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__p91811034123617">UseServerSidePrepare</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__p31811134143616">Whether to enable the extended query protocol for the database.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p19694134018382">The value can be <strong id="EN-US_TOPIC_0000001233563107__b077453514403">0</strong> or <strong id="EN-US_TOPIC_0000001233563107__b17931539164016">1</strong>. The default value is <strong id="EN-US_TOPIC_0000001233563107__b117551143174012">1</strong>, indicating that the extended query protocol is enabled.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__p318163493616">UseServerSidePrepare=1</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__row18741310143913"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__p674191083916">UseBatchProtocol</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__p67427101397">Whether to enable the batch query protocol. If it is enabled, the DML performance can be improved. The value can be <strong id="EN-US_TOPIC_0000001233563107__b1373822484216">0</strong> or <strong id="EN-US_TOPIC_0000001233563107__b625162834215">1</strong>. The default value is <strong id="EN-US_TOPIC_0000001233563107__b1789418329425">1</strong>.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p20481152784010">If this parameter is set to <strong id="EN-US_TOPIC_0000001233563107__b84343563446">0</strong>, the batch query protocol is disabled (mainly for communication with earlier database versions).</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p05131728428">If this parameter is set to <strong id="EN-US_TOPIC_0000001233563107__b131443910476">1</strong> and the <strong id="EN-US_TOPIC_0000001233563107__b064661434714">support_batch_bind</strong> parameter is set to <strong id="EN-US_TOPIC_0000001233563107__b779722310470">on</strong>, the batch query protocol is enabled.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__p7742101083917">UseBatchProtocol=1</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__row9789524184113"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__p182621858115514">ConnectionExtraInfo</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__p1626217582555">Whether to display the driver deployment path and process owner in the <strong id="EN-US_TOPIC_0000001233563107__b289818416191">connection_info</strong> parameter mentioned in <a href="dws_04_0889.html#EN-US_TOPIC_0000001188482316__section4834457114318">connection_info</a></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__p42621158185515">ConnectionExtraInfo=1</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001233563107__note523613263217"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0000001233563107__p17978439306">The default value is <strong id="EN-US_TOPIC_0000001233563107__b84235270692512">1</strong>. If this parameter is set to <strong id="EN-US_TOPIC_0000001233563107__b341813202610">0</strong>, the ODBC driver reports the name and version of the current driver to the database. If this parameter is set to <strong id="EN-US_TOPIC_0000001233563107__b4418192432615">1</strong>, the ODBC driver reports the name, deployment path, and process owner of the current driver to the database and records them in the <strong id="EN-US_TOPIC_0000001233563107__b1230445219262">connection_info</strong> parameter (see <a href="dws_04_0889.html#EN-US_TOPIC_0000001188482316__section4834457114318">connection_info</a>). You can query this parameter in <a href="dws_04_0755.html">PG_STAT_ACTIVITY</a> and <a href="dws_04_0820.html">PGXC_STAT_ACTIVITY</a>.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__row739073014314"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__p1849912015319">ForExtensionConnector</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__p5499190236">ETL tool performance optimization parameter. It can be used to optimize the memory and reduce the memory usage by the peer CN, to avoid system instability caused by excessive CN memory usage.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p6518342615">The value can be <strong id="EN-US_TOPIC_0000001233563107__b18239204115211">0</strong> or <strong id="EN-US_TOPIC_0000001233563107__b10242241135210">1</strong>. The default value is <strong id="EN-US_TOPIC_0000001233563107__b3242194155213">0</strong>, indicating that the optimization item is disabled.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p1411518281664">Do not set this parameter for other services outside the database system. Otherwise, the service correctness may be affected.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__p94991703315">ForExtensionConnector=1</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__row1883713421016"><td class="cellrowborder" valign="top" width="25.96%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__p783819347107">KeepDisallowPremature</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.4%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__p2083823451016">Specifies whether the cursor in the SQL statement has the <strong id="EN-US_TOPIC_0000001233563107__b4734151392">with hold</strong> attribute when the following conditions are met: <strong id="EN-US_TOPIC_0000001233563107__b2821515143918">UseDeclareFetch</strong> is set to <strong id="EN-US_TOPIC_0000001233563107__b128291514396">1</strong>, and the application invokes <strong id="EN-US_TOPIC_0000001233563107__b08316154394">SQLNumResultCols</strong>, <strong id="EN-US_TOPIC_0000001233563107__b58361510393">SQLDescribeCol</strong>, or <strong id="EN-US_TOPIC_0000001233563107__b118411520399">SQLColAttribute</strong> after invoking <strong id="EN-US_TOPIC_0000001233563107__b15851515103910">SQLPrepare</strong> to obtain the column information of the result set.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p384601861117">The value can be <strong id="EN-US_TOPIC_0000001233563107__b1010517165212">0</strong> or <strong id="EN-US_TOPIC_0000001233563107__b3131135529">1</strong>. <strong id="EN-US_TOPIC_0000001233563107__b152973716522">0</strong> indicates that the with hold attribute is supported, and <strong id="EN-US_TOPIC_0000001233563107__b16503232526">1</strong> indicates that the with hold attribute is not supported. The default value is <strong id="EN-US_TOPIC_0000001233563107__b34711931175218">0</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34.64%" headers="mcps1.3.2.2.4.2.1.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__p12838153410105">KeepDisallowPremature=1</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001233563107__note18513115321111"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0000001233563107__p10613134610323">When <strong id="EN-US_TOPIC_0000001233563107__b1252115115317">UseServerSidePrepare</strong> is set to <strong id="EN-US_TOPIC_0000001233563107__b154913425317">1</strong>, the <strong id="EN-US_TOPIC_0000001233563107__b493861512534">KeepDisallowPremature</strong> parameter does not take effect. To use this parameter, set <strong id="EN-US_TOPIC_0000001233563107__b629262515312">UseServerSidePrepare</strong> to <strong id="EN-US_TOPIC_0000001233563107__b18253102785313">0</strong>. For example, set <strong id="EN-US_TOPIC_0000001233563107__b1039543255316">UseDeclareFetch</strong> to <strong id="EN-US_TOPIC_0000001233563107__b142681334165312">1</strong>.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p118240208573">KeepDisallowPremature=1</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p3825142018579">UseServerSidePrepare=0</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001233563107__ad2bc823fa43b4a548cb879dcffdefbde">The valid values of <strong id="EN-US_TOPIC_0000001233563107__b842352706194155">sslmode</strong> are as follows.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001233563107__t94b5d25de9a74a5f94c8a8a03af55265"></a><a name="t94b5d25de9a74a5f94c8a8a03af55265"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233563107__t94b5d25de9a74a5f94c8a8a03af55265" frame="border" border="1" rules="all"><caption><b>Table 3 </b>sslmode options</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233563107__rb8627c74a8994a588308f605322445a8"><th align="left" class="cellrowborder" valign="top" width="14.87%" id="mcps1.3.2.2.4.2.1.2.6.2.4.1.1"><p id="EN-US_TOPIC_0000001233563107__abeba54185a7c4354af637f44d26a3f6d">sslmode</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="18.87%" id="mcps1.3.2.2.4.2.1.2.6.2.4.1.2"><p id="EN-US_TOPIC_0000001233563107__ab3fd88c026b84abfa47e9f5310ba6f93">Whether SSL Encryption Is Enabled</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="66.25999999999999%" id="mcps1.3.2.2.4.2.1.2.6.2.4.1.3"><p id="EN-US_TOPIC_0000001233563107__a6e62062f40734e7194f6c17ecafd50b1">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001233563107__rc6f7192d49394a9a9a3f07dac88dc222"><td class="cellrowborder" valign="top" width="14.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__a9032ee3b6ff447ea9b5ca2b7f4d051f0">disable</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__ad25c7c7a4b604394908de031d3fc082e">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.25999999999999%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__afe30cc64583641bcab2ee2bac63f22d9">The SSL secure connection is not used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__rd132c08eb3f74555a79adaa36ef5fca5"><td class="cellrowborder" valign="top" width="14.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__af433cb7ee4fc4cc191d1fc70c8872d52">allow</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__aa89ef1022501425eab92c4361ea86ddf">Probably</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.25999999999999%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__ade1f28e55ec54a5ab9876beb09f12139">The SSL secure encrypted connection is used if required by the database server, but does not check the authenticity of the server.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__r3b0059f6f80e4abba3adbd88d95bec8d"><td class="cellrowborder" valign="top" width="14.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__a33be2f0b4ae44720b38810bd035ad362">prefer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__acb0c87f777884e98b012f52de033b8b6">Probably</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.25999999999999%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a0d54b664758c41ea97888965d7c45306">The SSL secure encrypted connection is used as a preferred mode if supported by the database, but does not check the authenticity of the server.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__r0497f1a27bee4fb08112586f42678886"><td class="cellrowborder" valign="top" width="14.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__abacc3e199c0c4c139e15542ebdacec8e">require</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a7df79aac96484e6db8457eeb74690b45">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.25999999999999%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a4e1d4ff9a6974271a59ce157ac9fc200">The SSL secure connection must be used, but it only encrypts data and does not check the authenticity of the server.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__r7818d263608047399abed2c0379769f2"><td class="cellrowborder" valign="top" width="14.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__ad7eec2e8fcec46cda8d2ffd8b81a9945">verify-ca</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a15ee1e253a1b49d49d408bcef131bcd3">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.25999999999999%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a71f41054795247e3b4ce043685e1b76f">The SSL secure connection must be used, and it checks whether the database has certificates issued by a trusted CA.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563107__rdb5958041d9443759b51169077f09e80"><td class="cellrowborder" valign="top" width="14.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563107__af2f4cd3e414645b1bf20918fd160e72a">verify-full</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.87%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563107__a5fc092f773fc472f9b399a68ac4885fa">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.25999999999999%" headers="mcps1.3.2.2.4.2.1.2.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563107__a8d706965c05b424cb30a302c76d1e15b">The SSL secure connection must be used. In addition to the check scope specified by <strong id="EN-US_TOPIC_0000001233563107__b118215231004">verify-ca</strong>, it checks whether the name of the host where the database resides is the same as that on the certificate. This mode is not supported.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ol>
|
|
</p></li><li id="EN-US_TOPIC_0000001233563107__l4dd168526eef4e9f84490fa978474370"><span>Enable the SSL mode.</span><p><p id="EN-US_TOPIC_0000001233563107__a0fe3752d37aa4e8e92c9f0826dc38bd6">To use SSL certificates for connection, decompress the certificate package contained in the <span id="EN-US_TOPIC_0000001233563107__text1062120656">GaussDB(DWS)</span> installation package, and run <strong id="EN-US_TOPIC_0000001233563107__b1042914118388">source sslcert_env.sh</strong> in a shell environment to deploy certificates in the default location of the current session.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__a4d3c76bcd35d483e826ec52aae93c854">Or manually declare the following environment variables and ensure that the permission for the client.key* series files is set to 600.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001233563107__screen1422716433345">export PGSSLCERT= "/YOUR/PATH/OF/client.crt" # Change the path to the absolute path of <strong id="EN-US_TOPIC_0000001233563107__b84235270616948">client.crt</strong>.
|
|
export PGSSLKEY= "/YOUR/PATH/OF/client.key" # Change the path to the absolute path of <strong id="EN-US_TOPIC_0000001233563107__b8423527061691">client.key</strong>.</pre>
|
|
<p id="EN-US_TOPIC_0000001233563107__a20c554c23b5b48b6936f02de5f56b9f8">In addition, change the value of <strong id="EN-US_TOPIC_0000001233563107__b84235270616838">Sslmode</strong> in the data source to <strong id="EN-US_TOPIC_0000001233563107__b84235270616836">verify-ca</strong>.</p>
|
|
</p></li><li id="EN-US_TOPIC_0000001233563107__li1241323562214"><span>Add the IP address segment of the host where the client is located to the security group rules of GaussDB(DWS) to ensure that the host can communicate with GaussDB(DWS).</span></li><li id="EN-US_TOPIC_0000001233563107__l7cc674ac3062428aace807b7b29b04e0"><span>Configure environment variables.</span><p><pre class="screen" id="EN-US_TOPIC_0000001233563107__sebbf3ebe451f463aadfd8babc42b1019"><strong id="EN-US_TOPIC_0000001233563107__ad8c75131a9624b28b08cf92f6884c5b4">vim ~/.bashrc</strong></pre>
|
|
<p id="EN-US_TOPIC_0000001233563107__a9cca34b7e4dd4e378652bf4f0df8936a">Add the following content to the end of the configuration file:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001233563107__sfcbd5a5aea7b4457a7fc133926f32d5e">export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
|
|
export ODBCSYSINI=/usr/local/etc
|
|
export ODBCINI=/usr/local/etc/odbc.ini</pre>
|
|
</p></li><li id="EN-US_TOPIC_0000001233563107__l94b00dd76cf34213949da07601578b6c"><span>Run the following commands to validate the settings:</span><p><pre class="screen" id="EN-US_TOPIC_0000001233563107__se04eee66f6114f499381a66ff4dc9ab9"><strong id="EN-US_TOPIC_0000001233563107__a1e9e7bb1e14f414ea6ed1c0e3cdecd54">source ~/.bashrc</strong></pre>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233563107__saa097acabd2348f39e52e32d69e5e6ed"><h4 class="sectiontitle">Testing Data Source Configuration</h4><p id="EN-US_TOPIC_0000001233563107__a56d2638e9a6942c6a12303843da95e19">Run the <strong id="EN-US_TOPIC_0000001233563107__b2068652511372">isql</strong><em id="EN-US_TOPIC_0000001233563107__i12276864153257">-v GaussODBC</em> command (<em id="EN-US_TOPIC_0000001233563107__i11337240246">GaussODBC</em> is the data source name).</p>
|
|
</div>
|
|
<ul id="EN-US_TOPIC_0000001233563107__ufbf3d8011f7c48f4a2c511afba45bd47"><li id="EN-US_TOPIC_0000001233563107__l1adfc011026f46a4aefe690f47807507">If the following information is displayed, the configuration is correct and the connection succeeds.<pre class="screen" id="EN-US_TOPIC_0000001233563107__sc07a94723069485ea855dfdc0719da8c">+---------------------------------------+
|
|
| Connected! |
|
|
| |
|
|
| sql-statement |
|
|
| help [tablename] |
|
|
| quit |
|
|
| |
|
|
+---------------------------------------+
|
|
SQL> </pre>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__l1860c0ed35d54d35bf28f02a2a4bf93f">If error information is displayed, the configuration is incorrect. Check the configuration.</li></ul>
|
|
<div class="section" id="EN-US_TOPIC_0000001233563107__s427349e3618d4963a6b45da9035a48ef"><h4 class="sectiontitle">Troubleshooting</h4><ul id="EN-US_TOPIC_0000001233563107__u354c9c0b8cff4fb88cb16bb5bc6c525d"><li id="EN-US_TOPIC_0000001233563107__lc5cfc1de9b3f46dfb722feecb42725a3">[UnixODBC][Driver Manager]Can't open lib 'xxx/xxx/psqlodbcw.so' : file not found.<p id="EN-US_TOPIC_0000001233563107__adad7af8ead1146ecada00408e46bc2bf"><a name="EN-US_TOPIC_0000001233563107__lc5cfc1de9b3f46dfb722feecb42725a3"></a><a name="lc5cfc1de9b3f46dfb722feecb42725a3"></a>Possible causes:</p>
|
|
<ul id="EN-US_TOPIC_0000001233563107__u27c6bbd8237a4e9495a7e8f0d7083087"><li id="EN-US_TOPIC_0000001233563107__l7639b5166a8b4d4586b9a63278a87636">The path configured in the <strong id="EN-US_TOPIC_0000001233563107__b842352706165519">odbcinst.ini</strong> file is incorrect.<p id="EN-US_TOPIC_0000001233563107__a91b4b189095a4722b0f9908528fae377">Run <strong id="EN-US_TOPIC_0000001233563107__b200699616995751">ls</strong> to check the path in the error information, ensuring that the <strong id="EN-US_TOPIC_0000001233563107__b145896223295751">psqlodbcw.so</strong> file exists and you have execution permissions on it.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__lb1c6700de7004b5088296593c3c3042d">The dependent library of <strong id="EN-US_TOPIC_0000001233563107__b470702921043">psqlodbcw.so</strong> does not exist or is not in system environment variables.<p id="EN-US_TOPIC_0000001233563107__acdfdc2a2a8b547d3881d0a9f3b7f994c">Run <strong id="EN-US_TOPIC_0000001233563107__b138109057710415">ldd</strong> to check the path in the error information. If <strong id="EN-US_TOPIC_0000001233563107__b84235270617440">libodbc.so.1</strong> or other UnixODBC libraries are lacking, configure UnixODBC again following the procedure provided in this section, and add the <strong id="EN-US_TOPIC_0000001233563107__b84235270617934">lib</strong> directory under its installation directory to <strong id="EN-US_TOPIC_0000001233563107__b84235270617948">LD_LIBRARY_PATH</strong>. If other libraries are lacking, add the <strong id="EN-US_TOPIC_0000001233563107__b44835430810539">lib</strong> directory under the ODBC driver package to <strong id="EN-US_TOPIC_0000001233563107__b71526369010539">LD_LIBRARY_PATH</strong>.</p>
|
|
</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__l6409767edc904447a7019fc2ee247b84">[UnixODBC]connect to server failed: no such file or directory<p id="EN-US_TOPIC_0000001233563107__a3874d7ec5a3f4a719c80a6a0c015d9ae"><a name="EN-US_TOPIC_0000001233563107__l6409767edc904447a7019fc2ee247b84"></a><a name="l6409767edc904447a7019fc2ee247b84"></a>Possible causes:</p>
|
|
<ul id="EN-US_TOPIC_0000001233563107__uf65dd93812f246b395e8d92c7c9785a9"><li id="EN-US_TOPIC_0000001233563107__lfdfe3ad78c4b4bc48cc141b0dad8addc">An incorrect or unreachable database IP address or port was configured.<p id="EN-US_TOPIC_0000001233563107__aedd9068e86804631849f2a0858b037ec"><a name="EN-US_TOPIC_0000001233563107__lfdfe3ad78c4b4bc48cc141b0dad8addc"></a><a name="lfdfe3ad78c4b4bc48cc141b0dad8addc"></a>Check the <strong id="EN-US_TOPIC_0000001233563107__b84235270617125">Servername</strong> and <strong id="EN-US_TOPIC_0000001233563107__b84235270617126">Port</strong> configuration items in data sources.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__l52546393d3c74046836e42dcae282dc6">Server monitoring is improper.<p id="EN-US_TOPIC_0000001233563107__aa1b9bc19d81949d38ab693e84abb10ff"><a name="EN-US_TOPIC_0000001233563107__l52546393d3c74046836e42dcae282dc6"></a><a name="l52546393d3c74046836e42dcae282dc6"></a>If <strong id="EN-US_TOPIC_0000001233563107__b1122492246171315">Servername</strong> and <strong id="EN-US_TOPIC_0000001233563107__b787426547171315">Port</strong> are correctly configured, ensure the proper network adapter and port are monitored based on database server configurations in the procedure in this section.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__l825bf71116a44ec18b64cf01ec9db390">Firewall and network gatekeeper settings are improper.<p id="EN-US_TOPIC_0000001233563107__a8c93f010295e4ce392973621564bba7a"><a name="EN-US_TOPIC_0000001233563107__l825bf71116a44ec18b64cf01ec9db390"></a><a name="l825bf71116a44ec18b64cf01ec9db390"></a>Check firewall settings, ensuring that the database communication port is trusted.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__aac867e229f044ec59b73ad24d45b2db8">Check to ensure network gatekeeper settings are proper (if any).</p>
|
|
</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__lc38f7c923dd24939b09673c49887e747">[unixODBC]The password-stored method is not supported.<p id="EN-US_TOPIC_0000001233563107__a398654689bf44067b5c8fc52906642ba"><a name="EN-US_TOPIC_0000001233563107__lc38f7c923dd24939b09673c49887e747"></a><a name="lc38f7c923dd24939b09673c49887e747"></a>Possible causes:</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__aa679b7adc4c2498eaa5cccfef20fe5d6">The <strong id="EN-US_TOPIC_0000001233563107__b842352706171845">sslmode</strong> configuration item is not configured in the data sources.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__a6d72aeca46014b489eec3155821e2d9c">Solution:</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__a09659ab16e464c849de3c1f73e75d827">Set it to <strong id="EN-US_TOPIC_0000001233563107__b1451011451105">allow</strong> or a higher level. For more details, see <a href="#EN-US_TOPIC_0000001233563107__t94b5d25de9a74a5f94c8a8a03af55265">Table 3</a>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__l4bc2d69d76da4983aab051022c0a7ef0">Server common name "xxxx" does not match host name "xxxxx"<p id="EN-US_TOPIC_0000001233563107__a016ce2a0cb6046eea751ed24ee9fca87"><a name="EN-US_TOPIC_0000001233563107__l4bc2d69d76da4983aab051022c0a7ef0"></a><a name="l4bc2d69d76da4983aab051022c0a7ef0"></a>Possible causes:</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__af9c067bb6ce5408290e8ad07190ade2f">When <strong id="EN-US_TOPIC_0000001233563107__b84235270617209">verify-full</strong> is used for SSL encryption, the driver checks whether the host name in certificates is the same as the actual one.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p26205172315">Solution:</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__a28f93b3096cb46e0a77bd7d8858196b1">To solve this problem, use <strong id="EN-US_TOPIC_0000001233563107__b128944551018">verify-ca</strong> to stop checking host names, or generate a set of CA certificates containing the actual host names.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__ldfdb6fde12d6484dabf2092bce361da0">Driver's SQLAllocHandle on SQL_HANDLE_DBC failed<p id="EN-US_TOPIC_0000001233563107__aa17598e5a5b243f19e02ddfd16427094"><a name="EN-US_TOPIC_0000001233563107__ldfdb6fde12d6484dabf2092bce361da0"></a><a name="ldfdb6fde12d6484dabf2092bce361da0"></a>Possible causes:</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__a5cff334e1f8c45ae8098a76414b8ab94">The executable file (such as the <strong id="EN-US_TOPIC_0000001233563107__b1086144125216">isql</strong> tool of unixODBC) and the database driver (<strong id="EN-US_TOPIC_0000001233563107__b133076454526">psqlodbcw.so</strong>) depend on different library versions of ODBC, such as <strong id="EN-US_TOPIC_0000001233563107__b133185220520">libodbc.so.1</strong> and <strong id="EN-US_TOPIC_0000001233563107__b1941945519527">libodbc.so.2</strong>. You can verify this problem by using the following method:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001233563107__s5d1441f58bf041e7b8deddd889ddbf6b">ldd `which isql` | grep odbc
|
|
ldd psqlodbcw.so | grep odbc</pre>
|
|
<p id="EN-US_TOPIC_0000001233563107__a48a8633b88cd4661b59108fa4b444d19">If the suffix digits of the outputs <strong id="EN-US_TOPIC_0000001233563107__b842352706114424">libodbc.so</strong> are different or indicate different physical disk files, this problem exists. Both <strong id="EN-US_TOPIC_0000001233563107__b062684214244">isql</strong> and <strong id="EN-US_TOPIC_0000001233563107__b1123714718244">psqlodbcw.so</strong> load <strong id="EN-US_TOPIC_0000001233563107__b842352706144045">libodbc.so</strong>. If different physical files are loaded, different ODBC libraries with the same function list conflict with each other in a visible domain. As a result, the database driver cannot be loaded.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p55517281534">Solution:</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__a1fe8921743d94448b7ae2db3abb2d18f">Uninstall the unnecessary unixODBC, such as libodbc.so.2, and create a soft link with the same name and the .so.2 suffix for the remaining libodbc.so.1 library.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__li289151510231">FATAL: Forbid remote connection with trust method!<p id="EN-US_TOPIC_0000001233563107__p11101745162419"><a name="EN-US_TOPIC_0000001233563107__li289151510231"></a><a name="li289151510231"></a>For security purposes, the CN forbids access from other nodes in the cluster without authentication.</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p572510297236">To access the CN from inside the cluster, deploy the ODBC program on the machine where the CN is located and use 127.0.0.1 as the server address. It is recommended that the service system be deployed outside the cluster. If it is deployed inside, the database performance may be affected.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__li3541172410497">[unixODBC][Driver Manager]Invalid attribute value<p id="EN-US_TOPIC_0000001233563107__p195415245493"><a name="EN-US_TOPIC_0000001233563107__li3541172410497"></a><a name="li3541172410497"></a>This problem occurs when you use SQL on other GaussDB. The possible cause is that the unixODBC version is not the recommended one. You are advised to run the <strong id="EN-US_TOPIC_0000001233563107__b758001441516">odbcinst --version</strong> command to check the unixODBC version.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__li15833327382">authentication method 10 not supported.<p id="EN-US_TOPIC_0000001233563107__p145841632103816"><a name="EN-US_TOPIC_0000001233563107__li15833327382"></a><a name="li15833327382"></a>If this error occurs on an open source client, the cause may be:</p>
|
|
<p id="EN-US_TOPIC_0000001233563107__p10105114685419">The database stores only the SHA-256 hash of the password, but the open source client supports only MD5 hashes.</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001233563107__note16467135295418"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001233563107__ul11574125164710"><li id="EN-US_TOPIC_0000001233563107__li65741051184712">The database stores the hashes of user passwords instead of actual passwords.</li><li id="EN-US_TOPIC_0000001233563107__li35747517478">In versions earlier than V100R002C80SPC300, the database stores only SHA-256 hashes and no MD5 hashes. Therefore, MD5 cannot be used for user password authentication.</li><li id="EN-US_TOPIC_0000001233563107__li65752051134716">In V100R002C80SPC300 and later, if a password is updated or a user is created, both types of hashes will be stored, compatible with open-source authentication protocols.</li><li id="EN-US_TOPIC_0000001233563107__li1357517513474">An MD5 hash can only be generated using the original password, but the password cannot be obtained by reversing its SHA-256 hash. If your database is upgraded from a version earlier than V100R002C80SPC300, passwords in the old version will only have SHA-256 hashes and not support MD5 authentication.</li></ul>
|
|
</div></div>
|
|
<p id="EN-US_TOPIC_0000001233563107__p1747716611525">To solve this problem, you can update the user password. Alternatively, create a user, assign the same permissions to the user, and use the new user to connect to the database.</p>
|
|
</li><li id="EN-US_TOPIC_0000001233563107__li5727551235">unsupported frontend protocol 3.51: server supports 1.0 to 3.0<p id="EN-US_TOPIC_0000001233563107__p1217219362238"><a name="EN-US_TOPIC_0000001233563107__li5727551235"></a><a name="li5727551235"></a>The database version is too early or the database is an open-source database. Use the driver of the required version to connect to the database.</p>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0117.html">ODBC-Based Development</a></div>
|
|
</div>
|
|
</div>
|
|
|