CLI Connect to heidiSQL specific DBs

[expired user #8716]'s profile image [expired user #8716] posted 6 years 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

[expired user #12115]'s profile image [expired user #12115] posted 6 years 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.