To Remotely connect a SQL Database through Internet - remote-desktop

I want to connect to a remote computer though internet to connect a SQL Server database. I tried using Teamviewer successfully. Is there any other free tool which can be used in lieu of Teamviewer ?

There are are a few options.
1) Setup up VNC (there are a lot of free VNC implementations). If you set it up, I would recommend setting it up using SSH or some form of encryption so you are secure.
2) Set up a remote vpn connection. If the remote router supports something like DDWRT you can install that and set up you can vpn in to the remote network and access the machine as if you were there locally.
3) Set up port forwarding on the remote router so that when you connect to a specific port (default for SQL server is 1433) it forwards your request to the remote machine and then you just connect to the external IP of the remote router.
4) Set up port forwarding for Windows remote desktop. Basically the same as #3 except a different port and you'd use RDP to connect to the machine first instead of SQL server.

You can use MySQL Workbench tool for this purpose .. it's really simple ...
Just configure a new connection with the tool and you get to access the database remotely...

Just connect directly using SQL Server authentication
Update: or use trusted connection through VPN (IPSec).
If this question involves connection to SQL Server through internet. If not, then it is not development question and does not belong to SO.

Related

How to Enable TCP/IP for mssql instance in ubuntu 16.04?

I'm not able to connect SQL Server hosted in Ubuntu 16.04 using my program, I believe its because the TCP/IP is disabled for the instance I try to connect (Protocols for SQLEXPRESS under SQL Server network configuration).
How I'm sure because I tried to connect my program to SQL Server that hosted in Windows and it able to connect.
Example my instance name is SQLEXPRESS, so I'm trying to connect through SSMS by using IP Adress\SQLEXPRESS and it fails. But I am able to connect to the SQL if I use IP address only as the server name.
I tried to search about sqlcmd for enable the tcp/ip but all of them just show the guide to change the ports.
So, how can I enable tcp/ip connection for ip\SQLEXPRESS instance in Ubuntu 16.04?
picture below just an example on enabling tcp/ip for the sql instance in windows
I believe the reason why this doesn't work on linux is because it doesn't have a SQL Server Browser application that Windows has available. This application redirects the requests to 1433 to whatever random port it's listening to currently -- this is why it will only connect when the port is specified. In my case this stinks because I'm having to work around an ancient application that we don't have the source code for. I'm thinking about writing a little application that will redirect the default traffic to the correct port for linux msssql.

Connect to MS SQL Server 2014 from a computer on a different network

I have created an Application in VB.NET with database in MSSQL 2014.
I have configured TCP/IP=1433, UDP=1434, Windows Firewall is configured to allow 1433, 1434, sqlserver.exe, sqlbrowser.exe and server's login settings are configured. Application is working on my laptop which is on the same Internet connection as the host computer. I am trying to use the Application on client computer which is on another network and getting NAMED PIPES PROVIDER error40.
This is connection I am using:
Data Source=myServerName;InitialCatalog=dbName;UserId=clientcomputerName;Password=x
Do I need to configure client's computer in any way?
Does your DNS/HOSTS file resolve the remote computer name? Try IP address instead if not. Not sure but not all versions of SQL support remote connections via Named Pipes (can sometimes get round this by using registry hacks to add the connection as ODBC)

Can I connect to a SQL Server that is external to my network?

I'm not sure if this is possible.
My office Pc sits on the corporate network and to access anything outside this network I have to provide my username and password to get though the proxy.
We have recently purchased a hosted server external to this network so that we can host demo applications that can be access from anywhere. However when we need to connect to the server to update or work on the database we need to use a PC that is not on our network as there is no way to provide my username and password as either part of a connection string or in the management console.
The external server is running SQL Server 2008.
Any advise would be much appreciated as I'm not sure if this is even possible.
Thanks!
You can create an http tunnel between the server and the computer from which you want to access the SQL server.
Use HTTPtunnel GNU package for the organization HTTP tunnel.
Here an example of a HTTP tunnel to connect to the MySQL server.
To connect to SQL server you must specify the appropriate port.
try to use TeamViewer.
1. Installed on the server TeamViewer ... during the installation process specify a fixed password for remote access. remember or write ID (9 digits)
2. on your work computer install teamviewer.
connect to remote server ID and password.

connect sql server 2005/2008 over internet

How do I connect to SQL Server 2005/2008 using Management Studio or other desktop application over the internet?
Check out WCF Data Services:
http://msdn.microsoft.com/en-us/data/bb931106.aspx
That way, you don't have to totally expose your database server out to the internet, but you get fine grained control over what gets exposed and who (which type of user) can see or modify what.
Marc
I finally solved this by:
Changing default SQL Port to 8080 from 1433 (our ISP was blocking)
Turning off Windows Firewall on the server. I know this is not a long term solution, but at least I was able to pinpoint the problem. I had set two inbound firewall rules to allow port 8080 and SSMS program, on the server. I created an outbound firewall rule on the client for SSMS (but don't think this mad a difference).
I had to change all apps to use the new port instead of the default port. I had to configure our router to handle the new port 8080 and forward to the database server.
I will modify the Windows Firewall settings to see what was blocking SSMS.
DB Server: Windows 7 Pro 64bit 24 GB RAM
If you put 'your' SQL server (any brand, I'm not bashing) on the internet ... it won't be yours for long, unless you add some rather effective security measures ...
I suggest you look into VPN.
To be able to access your database over the internet, you will need to make sure that the server that hosts the database is accessible over the internet and the port that the database instance uses is open on that machine. You will also need to allow remote connections using the SQL Server Configuration Tool.
For Management Studio access I would recommend rather than opening the server to the outside to use a VPN solution that allows you to create a secure connection to the server and from there you can use the server name or IP to connect as if your machine is part of that network.
For the desktop application I would recommend looking into having the data be consumed through a web service or WCF rather than needing to have a direct connection to the database over the internet.
Hope this helps.
Firstly, if we put security consideration on the side, you have to configure SQL server (sql surface area configuration) to accept traffic, then you have to open proper ports on you server and allow inbound traffic thru to your router to the SQL server.
When you open sql server management studio in connect to server window and at the server name type the IP of your server and enter your username and password.
correct format : IP\InstanceName
you should have a user on target database.

How to make SQL Server running in Virtual PC accessible to host OS?

I'm running SQL Server 2008 Express on Windows XP on a VirtualPC instance inside a Windows XP host. I want to be able to connect to databases on the guest instance using SSMS on the host. When I go to connect from SSMS on the host, and browse for servers, I see the instance of SQL Server on the guest. Yet when I try to connect, using a SQL authentication login, I get the following connection error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 28 - Server doesn't support requested protocol) (Microsoft SQL Server, Error: -1)
I have:
* tried connecting with both Name Pipes and TCP/IP
* ensured that the SQL Browser service is up
* ensured that the firewall on the guest is open
* the server is configured to allow remote connections (according to the database engine properties within SSMS on the guest)
What am I missing?
EDIT: I figured this out. My resolution is below.
SELF-ACCEPTED ANSWER
Thanks for the ideas. After much fiddling I got things working. It turned out that I had not gone into the Sql Server Configuration Manager and enabled TCP/IP and Named Pipes as network protocols. So even though SSMS said remote connections were enabled, there was no protocol to allow for them other than shared memory. After I did this I restarted the SQL Server service, but things still didn't seem to work properly. Yet once I had rebooted both the guest and host, everything was working as expected.
How are your IP settings? Are you sharing the same IP address between the two machines? If so, then perhaps when your clients attempt to connect to 10.1.1.10, it is hitting the IP of the machine hosting the VPC instance, and that machine is not running the SQL Server instance. If possible, have VPC get its own IP and try that.
Mostly double check what you have already said,
turn off the guest firewall to make sure it isn't that.
Make sure your virtual machine networking is set to bridged and not NAT.
Try connecting to the IP address of the guest instead of its name.
Make sure the remote connections are allowed by SQL server and that both client and server are using tcp/ip (or named pipes if you prefer).
I don't know if enabling remote connections requires a restart of SQL server.
Try using SQL authentication to eliminate an authentication issue. Are you running on a domain?
To add some steps that are not explicitly called out above, what worked in my experience was to set up the Virtual PC's Networking to my physical network adapter.
Then disabled Windows Firewall for the Public Profile.
Hopefully could actually lock that down to port 1433.
Also, on the guest OS, if SQL Server is installed with only Windows Auth, you later add SQL auth, note that by default 'sa' is disabled for login access. Either 'enable' Login for 'sa' or (better idea) create Logins with appropriate permissions as needed.

Resources