Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

CLI Connect to heidiSQL specific DBs

wasimxe's profile image wasimxe posted 1 year ago in General Permalink

Hi,

I am developing a tool, see here please http://prntscr.com/lo28sn Each project has specific database and on click, I want to open heidiSQL with specific databases only.

I tried many commands from google but each command open all databases instead of specific

mattcarl99's profile image mattcarl99 posted 10 months ago Permalink

The command line allows you to direct/preload an .sql file using the "<" function.

Example:

C:\HeidiSQL\heidisql.exe --description "My Session" < "c:\original\selectTest.sql"

If you use "USE" at the beginning, you can designate the database to use.

;;;;;; selectTest.sql ;;;;;;;

USE yourDatabaseNameHere; (not in quotes oddly enough)

SELECT * FROM yourTable ;

This solved an issue I was having. Hope it helps.

Please login to leave a reply, or register at first.