Cant connect with command line. GUI connects ok

peperfus posted 4 years ago in Creating a connection

First, thank you for this wonderful mysql client. I'm considering making a donation. I will if you solve my problem.

Sorry for bad english.

I am trying to connect with command line to my remote server.
All parameters are OK
user ok
password ok
host ok
port ok

When I use GUI, connects ok, it works perfect.
But using command line fails:
Cant connect to mysql server on '' (10061)

Also, Don't understand why it tries to connect to localhost, when I specified -h=remoteserverurl.com (also tried -h=remoteserverIP).

My heidisql is latest. I have read several solutions, but none worked for me or didn't understand. I don't use "plink.exe" (neither know what it is...), In GUI, I use normal connection.

Thank you

Thank you.
kalvaro posted 4 years ago
You apparently have a bogus = sign. The valid syntax is:

--host=host_name, -h host_name

To make this off-topic, Tools-> Launch command line will connect automatically for you.
peperfus posted 4 years ago
I am trying to connect with command line for adding an entry to KeePass.

Windows command line (cmd):
heidisql.exe -h abcd.com -u user -p pwd -P port

still same error.

If I use such parameters in GUI, connects ok.

I am using windows xp
No mysql installed.

Still don't understand why tries to connect to instead of abcd.com

Thanks for your help
ansgar posted 4 years ago
I get "Can't connect to MySQL server on 'abcd.com' (10060)" with your command line.

Please check which version of HeidiSQL you are running. I recall there was a bug which I fixed not so long ago. Updating to the latest release or build could fix your problem.
peperfus posted 4 years ago

I have tried something curious...
I have tried the same in an oracle vm virtualbox and it works from command line.
It must be some of my windows xp config or anything... firewall config or anything that doesn't let heidisql command line connect to remote host.

I keep testing till guess what is the matter and when I solve it I will post it.
peperfus posted 4 years ago
Ok, this is madness.

I have renamed my.ini of my wamp to my.ini.bak.
Try... WORKS OK.
Rename my.ini.bak to my.ini, Try... WORKS.
Try the latest portable version: WORKS
Try the latest installed version: WORKS.

Don't understand anything. Why works now and what solved the matter. MADNESS.

Try on my buddy computer... Doesn't work.
rename his my.ini to my.ini.bak
(wamp was allways stopped (all services down) in ALL cases)
Doesn't work.
Firewall --> OFF
Doesn't work.


Now it works on my computer. Doesn't work on his.
Worst of all is We don't know what solved the problem on mine.

Any suggestion to help clarify this mistery ?
ansgar posted 4 years ago
You did not read my notice about updating HeidiSQL?
peperfus posted 4 years ago
Hello, Yes, I read it. But I had already the latest version. Anyway I downloaded again it and installed and it kept failing.

Listen !!

I FOUND What makes it WORK !! and you won't believe it.

executing this:
heidisql.exe [parameters] DOESN'T WORK

BUT !!

heidisql.exe [parameters] WORKS PERFECT.
(more than 1 white space between heidisql.exe and [parameters])

heidisql [parameters] also works.
(five spaces between command and parameters)

I got crazy till I found this solution, but this is what works for me and my buddy.

Review your source code, ther part where you catch arguments string. It seems you cut some characters...
peperfus posted 4 years ago
forum code cut the spaces.

I meant:

(2 spaces)
(5 spaces)
peperfus posted 4 years ago
GREAT program, anyway. Very satisfied with it.

I just made a 5€ donation.

Thanks and continue making HeidiSQL better.
ansgar posted 4 years ago
Oh... multiple spaces. I should fix that.
ansgar posted 4 years ago
This seems to be a WinXP issue, along with Windows.GetCommandLine. On Win7, there is no requirement for more than 1 space.
ansgar posted 4 years ago
Fixed in r4727
ansgar posted 4 years ago
See also: http://social.msdn.microsoft.com/Forums/vstudio/en-US/5e737981-3ce1-4742-aa84-9d3f8c7a6b1d/getcommandline-space-problem-in-windows-2008?forum=vclanguage
peperfus posted 4 years ago
Perfect smile

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