Why does Datagrip say user/pass wrong when they work in Tableplus? - sql-server

I have Tableplus and it it connects and runs queries on a SQL Server database just fine.
When I replicate those connection settings exactly in Datagrip, it fails to connect and complains the username and password are incorrect. I have tried several times and been very thorough in checking that I'm entering the exact same usernames and passwords into both.
What am I doing wrong here?

can you share a little more in-terms of what you're entering in the other places. I use DataGrip for SS as well. I enter the IP for Host, port, then username and password without assigning the username to any instance something\username <-- ex, password obviously. Doublecheck the Database field, you can just leave it blank, it might be trying to route you to a specific database that those credentials don't have access to, so try either leaving it blank, or assigning it specifically. Then make sure the URL in the last box lines up with what you entered, sometimes it doesn't ... oddly enough.

Related

How to connect to MSSQL using tokens or encrypted strings

I have two questions that i cannot find an answer for.
I have already searched a lot.
The situation
I will deploy C# winforms application to a client, the app have users who should connect to my database on whatever host is to validate they are already logged in to prevent the same user from being logging again from other PCs, so basically when the user logs in the app sent a command to my DB that the XYZ user has been logged in.
The questions
First one and the most important one: how to access my MSSQL server from the client side without putting in the connection string because as you know someone may decompile the app and find the user and password, so basically how to TOKENIZE or ENCRYPT the sql connection string (may then will be decrypted in SQL server but i don't know how too)
The second question is: how effectively implement the above situation, as you know it is easy to send commands that hey I'm logged in and hey I'm logged out (when the user click log out) BUT... What if the electricity went off? the app will not have the chance to send log out command to my server and therefore the user will be LOGGED IN in my server even he is actually not.
Hopefully i do describe my questions properly.

VS not storing password in connection string, getting errors when dropping objects into dataclasses

I have no issues with windows authentication. However, using sql server authentication and selecting to save my password on the connection properties seems to work fine to pull up the databases and tables of a particular sql server instance, but when I try to drag and drop table objects into the object relational designer I get the following error...
"Failed to retrieve data for this request. Failed to connect to server (local). Login failed for user 'myusername'".
I've tried changing some advanced settings such as "authentication = sql password" to no avail. As far as I can tell, it is not storing my password in the connection string and I cannot find any way to manually change this. It forces me to use the dialog box to make changes to the connection string. My password is entered but is just ********* so ultimately it seems it really is not remembered (even though I've checked that box) and thus why i'm getting the login errors when dragging and dropping tables.
Does anyone know a workaround or fix....or if I'm missing something obvious. In the past (VS2013, VS2015) I don't remember having this issue.
Note that the string looks proper in the app.config file but still does not allow me to drag and drop tables from object explorer.

Test Oracle connectivity using sqlplus without password

I am in a unique situation where I need to test my server connectivity to Oracle databases however I do not have access to any account or password.
Reason why the connectivity needs to be tested is because many times there are multiple layers of firewalls between my servers and the database, and also particularly recently while trying to access RAC/Exadata databases we realized that doing a telnet on the "scan" IP range (which were the only range visible to me) was not enough and that there are underlying physical/virtual IPs that are actually used to connect which were blocked. If I can test connectivity I can at least confirm the database is accessible.
I thought about connecting using sqlplus test#DB, where "test" account doesn't actually exist. If I get a reply saying that incorrect username/password logon denied, then at least I know the database connectivity is working because at least it reached the database to perform authentication. But I have audit concerns (whether DBAs will think someone is trying to hack the system) and also whether there's an actual way or command to do this test.
like #OldProgrammer pointed out, this is pretty much an optimal case for tnsping from the command line
tnsping MY_SERVICE_NAME
Here's a good post showing the basic options. Oh, and I'm pretty sure the DBA's can still see the traffic if they want to.

phpmyadmin md5 decryption issue after importing database

I have a database on a cpanel server, which contains a user field called 'password'. When I look at the field through phpmyadmin, all the passwords appear as md5 encrypted.
So for example, a password thats '12345' would be encrypted and appearing in the database as "e10adc3949ba59abbe56e057f20f883e".
Now, on the original server, thats ok, because even if the password is encrypted in database, when I enter the password on the related website as '12345' it recognizes it and gives access.
The problem is when I export and import the database. After importing the same database into another server, naturally the password values are still encrypted in the database. But, when I try logging in into the related website, the decrypted password, tht is, '12345' does not work anymore. I have to enter the password as "e10adc3949ba59abbe56e057f20f883e" and only then I can login. So I'm guessing the problem is that the data in the password column is not getting decrypted after importing to another database, hence when I enter '12345' instead of the extended md5 value, it does not match and gives me a wrong password error.
So can anyone help me solve this issue? I am supposed to migrate this website on another server, and its a school system, and currently none of my users have access because of this issue.
Thanks.
md5 is not encryption, it's a one-way hash. You cannot find the original value from a hash.
On the second server, if the e10adc3949ba59abbe56e057f20f883e password works, the only reason I see, is that the application is not comparing the hash of the input value it received from the user, it's comparing the input value itself.

Credentials for the SQL Server Agent service are invalid

Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
I'm trying to install SQL Server 2008 development server on my local machine as administrator.
During the installation I receive this error, any idea how to solve it?thanks
[Error Message]
The credentials you provided for the SQL Server Agent service are invalid. To continue, provide a valid account and password for the SQL
Server Agent service.
[Details]
Microsoft.SqlServer.Configuration.Agent.InputValidationException: The credentials you provided for the SQL Server Agent service are
invalid. To continue, provide a valid account and password for the SQL
Server Agent service.
Use the credential that you use to login to PC. Username can be searched by Clicking in sequence
Advanced -> Find -> Choose your Username -> (e.g. JOHNSMITH_HP/John)
Password must be same as your windows login password
There you go !!
I solved using as credential built-in accounts as the NetworkService
this article point me out in the right direction
http://www.sqlcoffee.com/SQLServer2008_0013.htm
Under the "Account Name" Drop Box choose Browse.
Type the user name that you used to log in to windows on the
"Enter the object name to select" and then click "Check Names".
Click "Ok".
Under "Password" just type the password that you used for windows login.
In my case it was more of a Microsoft bug, than an actual issue. I installed under the Administrator login and used strong password btw but I was still getting this error constantly.
I tried to install with Windows credential without entering the password, but that did not go through either. Was getting the same error.
Then I cleared all password textboxes manually and copies the correct password in each text box. Hit enter, and it went through.
The error was most likely misleading.
There seem to be several problems that can cause this symptom. To tell them apart, one needs to look in the setup log files in %PROGRAMFILES%\Microsoft SQL Server\[versionnumber]\Setup Bootstrap\Log, probably Detail.txt.
According to this article, when running the installer as a local administrator and trying to use a domain account for the service, it may claim that the credentials are invalid because the local administrator does not have sufficient permissions in the domain to look up the service account's SID. This was the main problem I was encountering, and it might be what was affecting the original poster a year and a half ago.
I've had this error as a result of trying to use a cloned VM that had the same SID as the domain. The two options to fix it were: sysprep (or rebuild) the database server OR dcpromo the DC down and back up to change the domain SID.
I found I had to be logged in as a domain user.
It gave me this error when I was logged in as local machine Administrator and trying to add domain service account.
Logged in as domain user (but admin on machine) and it accepted the credentials.
In my case password was expired. Change the password and try the step again.
Well I have been battling to understand why, when at the Account section of the installation of a second node, the system will not accept the password I used to log in. I have been scratching my head - reading every post under the sun all to no avail.
I did notice that some service accounts were given as service.instname.instno#FDNdomain.com and others were given as DOMAIN\service.instname.instno (the latter being the Win2000 version)
I also noticed comments about strength of password so I thought - I can do that so I changed the password to a much higher strength and RDC in to the server - with new password and thought - best to update the services on the existing node first. I stopped the service, clicked on password and pasted in from the clipboard - (can't go wrong eh?) ha ha says Windows.. Got ya.. it wouldn't accept the password - that I just logged in with. I clicked on browse to select the service account and VOILA! the account name changed to the DOMAIN\user version and readily accepted the password. I then repeated the exercise on the other service. I then found that the node installation would continue (after backing up and forward through the process) to pick up the new name format and accepted the passwords without complaint.
I think the moral of this experience is to use the wizards and select through the "browse" button rather than manually entering the service name.
I hope my experience saves someone else the pain I went through.
Still Confused
I had a domain account with a strong password, but it didnĀ“t work, then I used Network Service account. I tried to change it on SQL Server Configuration Manager after installation and it worked.
Taking SQL Server cluster role offline-Online on node 1 worked for me.
I had a VM that was server 2012 and I had to change the nic to VMXNET 3. It wasn't connecting to the domain fast enough for the services to start I guess.
the button 'Use same account' below thee main window will fill in all the textboxes automatically. this worked fpr me.
You might encounter one of these three problems:
Password Policy Violation, find valuable information here: https://msdn.microsoft.com/en-us/library/ms161959.aspx
Password not starting with a "character"
Domain Service User's account might be locked.
A blog post with the summary for all three possible problems might be found here:
https://cms4j.wordpress.com/2016/11/29/0x851c0001-the-credentials-you-provided-for-the-sqlserveragent-service-is-invalid/

Resources