i

Command line switches


Although HeidiSQL is a pure GUI application, it can be automated for connecting

and opening files via command line parameters. Parameter names are case sensitive

and are based on those used by the MySQL command line applications, e.g. mysqldump.


-d, -description    Session name

-h, -host           Host name

-u, -user           User name

-p, -password       Password

-P, -port           Port (defaults to 3306 if not given)

-S, -socket         Socket name (for connecting via named pipe)

--psettings         Custom filename for portable settings. Ignored if file does not exist.

                    Default filename is "portable_settings.txt"


Examples:


* Start over using stored settings from session "xyz":

    c:\path\to\heidisql.exe -d=xyz

    c:\path\to\heidisql.exe -description=xyz


* Connect with different username or port:

    c:\path\to\heidisql.exe -d=xyz -u=OtherUser

    c:\path\to\heidisql.exe -d=xyz -P=3307


* Connect to a non-stored session:

    c:\path\to\heidisql.exe -h=localhost -u=root -p=Mypass -P=3307


* Open multiple .sql files in query tabs:

    c:\path\to\heidisql.exe fileA.sql path\to\fileB.sql fileC.sql ...


* Use custom portable settings file:

    c:\path\to\heidisql.exe --psettings=c:\temp\p.txt