ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

How to configure HeidiSQL tool to auto connect via TCP Service on PAM

book

Article ID: 213645

calendar_today

Updated On:

Products

CA Privileged Access Manager (PAM)

Issue/Introduction

How to configure HeidiSQL tool to auto connect via TCP Service on PAM?

Parameter passing into the Client Application parameter appears to be an issue when TCP Service for HeidiSQL tool (SQL client tool) is configured as the following on PAM (Privileged Access Management)

"c:\program files\HeidiSQL\heidisql.exe -h=<Local IP> -P=<First Port>"

or

"c:\program files\HeidiSQL\heidisql.exe" -h=<Local IP> -P=<First Port>"

In either case, the tool is started, but the connection needs to be made manually - using the IP and port indicated on the prompt.

Ideally additional parameters: -u (user), -p (password), -db (database) can be passed.

 

Environment

Release : 3.4.x

Component : PRIVILEGED ACCESS MANAGEMENT

Resolution

The ability to auto connect/auto login using HeidiSQL tool is depending on how HeidiSQL tool can be launched via command line. Here is HeidiSQL website that explains about the Command line switches (see the bottom part of the page) we can use to launch HeidiSQL via command line.

https://www.heidisql.com/help.php?place=connform#connecting

When tested in the lab using HeidiSQL to access MS SQL database, the following problems occurred. After overcoming these problems, HeidiSQL tool is launched and able to auto-connect successfully.
     1. When tested to launch HeidiSQL tool via command line, HeidiSQL process was run but no GUI appears.
         There is issue with regards to old library for accessing MS SQL. Without installing MSOLEDBSQL library, as the default old SQLOLEDB is less secure HeidiSQL shows warning dialog. It seems this dialog prevent the UI to launch if it is invoked from command line. So we need to install MSOLEDBSQL library. The library can be downloaded from the URL shown in the warning dialog.
     2. When using --library (-l) or --databases (-db) command line switches/arguments, HeidiSQL process was run but no GUI appears.
         To avoid this, create a pre-defined session (see below screen capture) just specifying Library and Database, and then utilize -d (--description) to look up the session in the command line.

Here is the TCP Service configuration. We can specify the following in the Client Application parameter. Notice that it uses -d option to refer to existing session.

"C:\Program Files\HeidiSQL\heidisql.exe" -u <User> -p <Password> -h <Local IP> -P <First Port> -d MSSQLSession

With this configuration, auto connect to MS SQL server using HeidiSQL tool via TCP Service is successful.

 

 

Additional Information

HeidiSQL tool is an open source freeware. Please refer https://www.heidisql.com/