Solved

Opening a Connection to SQL Server via a VPN Connection

Posted on 2015-01-01
4
155 Views
Last Modified: 2015-01-07
I'm trying to open a connection to a SQL Server instance via a VPN connection. The connection string I have is not working:

Provider=SQLNCLI11;Data Source=MySQLServer;Initial Catalog=MyDatabase;User Id=MyUSerID;Password=MyPassword;

I get this error:

Named Pipes Provider: Could not open a connection to SQL Server [53].

I also tried this connection string:

Provider=SQLNCLI11;Data Source=MySQLServer;Initial Catalog=MyDatabase;Integrated Security=SSPI

With what I think are my Windows credentials added to the list of security logins in SQL Server. To create the login, I used the VPN login credentials. I can't figure out how to add my workstation's Windows credentials - the workstation being the workstation on which I am running the VPN client.

What am I missing?

Kevin
0
Comment
Question by:zorvek (Kevin Jones)
4 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 167 total points
ID: 40527223
MySQLServer is Not MSSQL.  Two completely different products.

Windows credentials only work if the SQL Server is on the same machine or you are on Active Directory where the remote SQL Server can verify them.  Otherwise, you need to enable Remote connections on the SQL server and use SQL Authentication, username and password.

You can find connection strings for different situations here: http://www.connectionstrings.com/sql-server/
0
 
LVL 10

Assisted Solution

by:HuaMinChen
HuaMinChen earned 167 total points
ID: 40527262
Please ensure your connection string is something like
	<connectionStrings>
		<add name="conn2" connectionString="Data Source=192.?.?.?\your_db_instance;Initial Catalog=your_db_schema;Integrated Security=False;User ID=your_db_login;Password=??????" providerName="System.Data.SqlClient"/>
	</connectionStrings>

Open in new window


within Web.config/app.config file in your project, to ensure the project will work fine with the database.
0
 
LVL 69

Assisted Solution

by:Qlemo
Qlemo earned 166 total points
ID: 40527325
Named Pipes can get very problematic, in particular with non-domain clients. Make sure TCP/IP is enabled on MSSQL server and client. Disable Named Pipes on the client.
In regard of the authentication: You'll have to use explicit authentication, providing username and password, if not I the same domain.
0
 
LVL 81

Author Comment

by:zorvek (Kevin Jones)
ID: 40535936
This has turned out to be a network security issue so I'll close this question without identifying any specific response as a solution.

Kevin
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to shrink a transaction log file down to a reasonable size.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question