Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My site is not able to establish a connection to the SQL Server 2012 from EC2. My connection string is as follows:

Data Source=AMAZONA-2SSRDM3;Initial Catalog=MyDatabase;Integrated Security=SSPI;

As you can see I am using Windows Authentication; is there something wrong with this approach I am taking? I am new to Ec2

Please help

The New Connection string i am using is

 connectionString="Data Source=;Initial Catalog=MyDb;User ID=something;Password=something"

More Info : I just restored a new database on to my Ec2 Machine . My sql server instance was using only Windows Authentication which i changed to Mixed Mode. I created a new Login something and made it the Db Owner of the Restored Database as well

share|improve this question
up vote 1 down vote accepted

Change the data source parameter of the connection string to "localhost". When everything is running on the same machine there's no need to specify the actual host name. If you do need to specify the host name, when SQL Server is running on one server and the database is on another server for example, only specify the name of the server. In your case the connection string would reference the internal name of the server. In that case the connection string would look something like this.

connectionString="Data Source=ec2-46-137-228-121;Initial Catalog=MyDb;User ID=something;Password=something"

What ever the value in the data source you should be able to ping that name to make it work.

share|improve this answer
thank you :))... – vini Apr 29 '13 at 15:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.