Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.

Can't open a connection when using -psettings parameter

Suliman's profile image Suliman posted 3 months ago in General

When I start heidisql portable without any parameter and no portable_settings.txt existing, I can create a new connection which will be saved in portable_settings.txt. This connection can be opened without problems.

Then I start from commandline with the following parameters:
heidisql.exe -d unnamed

This also opens the connection, I configured just before.

But when I start with a psetting parameter, it does not work anymore:
heidisql.exe -psettings=portable_settings.txt -d unnamed

I receive the error message "SQL Fehler (18456): Login failes.for user ..."

The connection should connect to an azure sql server, if this an important information.

Could someone help me, how I could open a connection from commandline with a specific database?

Thank you and best regards

1 attachment(s):
  • Fehler
ansgar's profile image ansgar posted 3 months ago

If you add that -psettings parameter, all your sessions and settings are loaded from that file before connecting to that "unnamed" connection. Probably the "unnamed" connection in the portable_settings.txt is wrong configured? Just test by leaving away the -d unnamed parameter, and then open the unnamed session per mouse.

Suliman's profile image Suliman posted 3 months ago

Hello ansgar,

thanks for the fast reply i did what you suggested

then i got anothe message as writetten in the message MYsql which is not right i use Sql server

so then i tried to add -n 4 then i got another message that the provider could't connect with the goal Computer

My goal is that HEIDISQL.exe should open and connect to a specific Database which could change so it has to be flexible and im trying to make it work so then i will implement it in Visual Studio if i cant make it work anyhow would be amazing Best Regards

1 attachment(s):
  • dfsUnbenannt


Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.
ansgar's profile image ansgar posted 3 months ago

"-n 4" tells HeidiSQL the server is an MS SQL server - but the server must be listening at the specified port, man. You cannot expect HeidiSQL to connect to some MS SQL server when in fact the session parameters point to your MySQL installation.

You just have to set up your session parameters right, so your "unnamed" connection uses the right hostname, port, user and password (and maybe more advanced settings). You can save them in the default registry option, there is no need to create a portable_settings.txt file for it. Just save them. Then use them on the command line with that "-d unnamed" command line. And also you should rename "unnamed" to let's say "mariadb-local" or "mssql-remote" or whatever.

Suliman's profile image Suliman posted 3 months ago

Hello ansgar, thanks for the help sadlly it did not work out the way i wished it would be.

my last question is ,is there a Database parameter say - db ,becaus when i tried to exexute and connect Heidisql to the to a Server that has more than one Database it automaticlly connected it to the master and did not alowe me to switch between the database it sayes USE Statment is not supported or something

i look foreword to yout response

Thanks you

Suliman's profile image Suliman posted 3 months ago

Hello again, sorry for a new message i think it worked pretty well the only issue is that when i change the connection i should work as well but with the normal password did not work and i think according to the setting it has to be encrypted

Thanks

ansgar's profile image ansgar posted 3 months ago

Sorry, I am confused by your description. You could use more dots and commas.

However, if you store the connection once, manually, and then use the "-d master" parameter, that should work exactly the same way as when you do that per mouse.

Suliman's profile image Suliman posted 3 months ago

Hello ansgar, im very sory for the confusion and again thaks for the help. I needed the portable version because you don't have to install it and in that way it could be much easyer for someone how is not as much as experinced . I could change the Host name and the Database in the portable settings.txt File without having to type it manualy like through Visual studio ,nut the problem was, that the password password wasn't encrypted so the Program did not accept it, but the good thing is that i have one password for multiple servers and i only had to save it once throug the Program.

Big thanks for your offert and best regards. Suliman

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