I'm trying to deploy my .net website to a shared hosting server. I'm getting the following error when entity framework tries to connect to the database:
Server Error in '/' Application.
Login failed for user 'PHX3\Iusr_9086819'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'PHX3\Iusr_9086819'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Login failed for user 'PHX3\Iusr_9086819'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5061898
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
Here is my connection string, with sensitive data removed:
<add name="CoreEntities"
connectionString="
metadata=res://*/CoreModel.csdl|res://*/CoreModel.ssdl|res://*/CoreModel.msl;
provider=System.Data.SqlClient;
provider connection string='
Data Source=*****.db.*****.hostedresource.com;
Initial Catalog=kshoultz;
integrated security=True;
multipleactiveresultsets=True;
App=EntityFramework;
User ID=*****;
Password=*****;
Database=*****;
'"
providerName="System.Data.EntityClient" />
1 Answer 1
I think integrated security should be false - that means not to use a user id and password. Initial catalog is the name of the database - did they tell you the database was named kshoultz? (Could be, I don't know any different, but if you created a database and chose a name, that's the name you want to use). Has the password got any characters that aren't letters/numbers? You have to encode them, for example is your password is Love&Peace you have to say Love&Peace
Have you asked GoDaddy support?
-
Thank you. Setting integrated security to false solved the problem.jedi_kevo– jedi_kevo2012年03月14日 05:25:19 +00:00Commented Mar 14, 2012 at 5:25
-
This worked. Can you explain why Integrated security had to be turned off?Ratan– Ratan2012年08月24日 00:08:04 +00:00Commented Aug 24, 2012 at 0:08
-
2@Ratan Integrated security means that the person who is running the process is recognized by sql server as a windows user. In a shared environment, you don't want just any instance of the web server to access your database, or any other user on the machine could attach to your database - the "User" is some system account that is associated with the Web Server itself. So instead, it has to pass in a password. Shorter answer: "Integrated security" means you don't need a password.Levin– Levin2012年08月24日 19:17:09 +00:00Commented Aug 24, 2012 at 19:17