February 26, 2009 at 9:24 pm
hi gurus
i'm running the below osql command and i received the error login failed for user null.
osql -E -Slocalhost
security setting for sql server is already mixmode. i'm using a local account which is also a local server admin and is being used as the server account of sql server service.
any advise on this. thanks
art
February 26, 2009 at 10:04 pm
Please try using the "Server Name" or the "IP Address" instead of "localhost".
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
February 26, 2009 at 10:53 pm
same result:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
February 26, 2009 at 10:58 pm
Which Edition of SQL Server are you using and what is the Operating system?
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
February 26, 2009 at 11:14 pm
sql server standard edtion, windows server 2003 standard
February 26, 2009 at 11:28 pm
Can't use -E from a command prompt... only from SQL Server. Where are you trying to run the OSQL command from?
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2009 at 11:33 pm
Jeff Moden (2/26/2009)
Can't use -E from a command prompt... only from SQL Server.
I disagree with this. I have tried using -E (Trusted connection) and it works well from the command prompt.
Art,
Are you trying to connect to the "Default" instance or a named instance?
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
February 26, 2009 at 11:43 pm
Art,
Please check whether "BUILTIN\Administrators" have access to the SQL Server and also try adding the user again as below.
Grant [domain\user]
EXEC sp_grantlogin [domain\user]
--Add that account to the sysadmins role:
EXEC sp_addsrvrolemember @loginame = [domain\user]
, @rolename = 'sysadmin'
Also try whether you are able to connect to the server using "Query Analyzer" using Windows Authentication.
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
February 27, 2009 at 2:33 am
Whether your account is service account for SQL Server, it must be allowed to login to SQL Server by creating a windows login in SQL Server instance. Have your account also added in SQL Server?
February 27, 2009 at 6:22 am
Adiga (2/26/2009)
Jeff Moden (2/26/2009)
Can't use -E from a command prompt... only from SQL Server.I disagree with this. I have tried using -E (Trusted connection) and it works well from the command prompt.
Art,
Are you trying to connect to the "Default" instance or a named instance?
Ah.... you're right... my bad. If Windows Authentication is enabled, it works fine.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 27, 2009 at 7:16 am
i can now connect using localhost as the servername. But using hostname or IP address cannot.
February 27, 2009 at 8:54 pm
Hi Art,
You may want to check the Service Principal Name (SPN) for the service account. More information about SPNs is available here
SetSPN utility can be downloaded from here
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply