distal-attribute
distal-attribute
distal-attribute
distal-attribute

New feature: Launch command line window

User, date Message
Written by ansgar
2 years ago
Category: News
4936 posts since Fri, 07 Apr 06
After having established a MySQL or MariaDB connection, HeidiSQL offers to launch a command line window (located in the "Tools" menu). This executes mysql.exe from the directory which is set in Tools > Preferences > Miscellaneous. The clue is that HeidiSQL passes all connection parameters from the current connection to that command line, including host/user/password, named pipes and SSL settings.



Although HeidiSQL is a pure GUI, there are situations in which you benefit from a text based window, without the myriad of GUI controls Heidi offers.

To get this feature, you just need to update to the latest build (Help > Check for updates).

See also issue #2728 for more details. Thanks to jsdeter for the idea!
Written by cjunge
2 years ago
17 posts since Wed, 10 Nov 10
Doesn't seem to work in Wine. My path is set to Z:\usr\bin (ie \usr\bin). When I choose "Launch command line" I get "Error: You need to tell HeidiSQL where your MySQL binaries reside, in Tools > Preferences > Miscellaneous". I'm using Heidi on Ubuntu 11.04, with Wine 1.4rc2
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
Hm, well on Wine you likely do not have a "mysql.exe", which is searched for in HeidiSQL and if not you get the above error. I'll go and search for "mysql" if on Wine.
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
Fixed in r4074.
Written by cjunge
2 years ago
17 posts since Wed, 10 Nov 10
OK, no error now, and a message in the log window... but the command line app wasn't launched.

Message in log window:
/* Launching command line: Z:\usr\bin\mysql --host="127.0.0.1" --port=40281 --user="test" --password="********" --compress --database="test" */

Maybe Wine/linux launches apps differently?
Written by cjunge
2 years ago
17 posts since Wed, 10 Nov 10
BTW: amazingly fast response and turn-around! Awesome!
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
Can you try to find out the right command line syntax? I guess I have to add some bash syntax but I'm confused with the Windows-style path "Z:\..."
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
Oh, and good I have the password portion obscured - users tend to copy and paste stuff directly in forums - like you did above :)
Written by cjunge
2 years ago
17 posts since Wed, 10 Nov 10
In a bash shell:

/usr/bin/mysql --host="127.0.0.1" --port=40281 --user="test" --password="*********" --compress --database="test"

Works fine.
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
Hm ok, this looks normal for a Linux system. I only see you selected "Z:\usr\bin\" as the path to your binaries, and I think I won't be able to automatically translate that path to /usr/bin/, am I? Probably the Z: drive on Wine is always prefixed?
Written by cjunge
2 years ago
17 posts since Wed, 10 Nov 10
I originally selected the path using the "Browse for folder" dialog.

Manually changing the path doesn't work either:

/usr/bin => /usr/bin\mysql
/usr/bin/ => /usr/bin/\mysql
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
Yes, Heidi does not support native Linux calls yet. But I found some Wine help for winepath here: http://wiki.winehq.org/winepath

They say:

WinePath wrote: To launch documents from inside Windows apps, create a small shell script called e.g. /usr/bin/run_prog containing

#!/bin/sh
$1 "`wine winepath -u "$2"`"



If we don't want to create a shell script first, how should the command line look like using winepath? And, do all Wine users have winepath also or is that installed separately?
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
r4075 now
* disables the "browse for folder" dialog, so the user does not get a Windows-style path, instead he gets forced to write the path syntax by hand
* adds the right directory separator depending on Windows/Wine

There is a chance that the ShellExecute method does not succeed for some reason, but you could test again now, using /usr/bin as setting. Should not matter if you add or remove a trailing slash.
Written by cjunge
2 years ago
17 posts since Wed, 10 Nov 10
I've just updated to build 4078 and the command line stuff is still not working correctly.

I tried just using /usr/bin as the path. Then I tried adding the script /usr/bin/run_prog but that didn't work either.
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
Hm I don't know how to fix that. I'm just calling a ShellExecute() with your path /usr/bin/ and "mysql" as the command itself. No clue what's wrong here. Think we need deeper Wine knowledge here.
Written by cjunge
2 years ago
17 posts since Wed, 10 Nov 10
Does this help?
http://wiki.jswindle.com/index.php/Advanced_Wine_User_Information#Running_Linux_software_From_Wine
Written by kalvaro
2 years ago
587 posts since Thu, 29 Nov 07
It's an interesting feature I had never imagined but which I'll definitively use. Well thought!

Just an idea: it'd be perfect if it could find mysql.exe automatically. Microsoft has documented how to find an application [1]. The version of MySQL that's currently installed in my computer does not follow the recommended method but at least has modified the system's PATH.

[1] http://msdn.microsoft.com/en-us/library/windows/desktop/ee872121(v=vs.85).aspx
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
cjunge: The docs only say you can create a separate script - did you read that? I don't think that Heidi should go so far and create a bash script with the path to mysql from settings, and finally launch that script. But you could create your own script like described there and save it as "mysql" somewhere, then tell Heidi the path to that directory, so HeidiSQL does not start the mysql executable, but the script called mysql.
Written by cjunge
2 years ago
17 posts since Wed, 10 Nov 10
I might've found a solution:

$TERM -e /usr/bin/mysql --host="127.0.0.1" --port=40281 --user="test" --password="********" --compress --database="test"

Alternative is not to specify /usr/bin at all, and it'll use the default one in the system (using PATH).

$TERM should always be specified & I assume that -e will always be the flag to use to run the command.

Hopefully that helps.
Written by jfalchMoney, Euro
2 years ago
380 posts since Sat, 17 Oct 09
my $TERM is set to xterm, which is not installed on my debian server system. One should probably use
$SHELL -l -c ...
instead of
$TERM -e ...
on non-X systems, or generally those where
which $TERM
returns $? > 0.

Also, $SHELL -l -c `which mysql` could be helpful.
Written by cjunge
2 years ago
17 posts since Wed, 10 Nov 10
jfalch: I assumed that WINE needs to run on a system with X, so assumed that $TERM would work.

Your suggestion might be safer.
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
Ok, I'll try the $SHELL approach.
Written by jfalchMoney, Euro
2 years ago
380 posts since Sat, 17 Oct 09
please disregard my last comment. cjunge is right: when you are running heidisql on a linux system, you are running it under wine; wine needs X; when X is installed, $TERM will be set to a meaningful value, so you should use $TERM -c.
The above-mentioned situation ($TERM points nowhere) is a rare, negligible special case when running X.
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
So, $TERM -c is it, or $TERM -e as noted above ?
Written by jfalchMoney, Euro
2 years ago
380 posts since Sat, 17 Oct 09
Bother, mistyped. Not my day. Should be $TERM -e as in cjunge┬┤s original post - cf man xterm (search for -e).
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
Done in r4080 . I guess this is hopeless - $TERM must now get passed by ShellExecute which may be a new problem.. don't know, please test.
 

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