CLI Connect to heidiSQL specific DBs

wasimxe posted 5 months ago in General

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 posted 3 months ago

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.