I have a SQL Server 2008 - R2 database - database - configured to receive connection from internet.
The computers from LAN (Local clients) can connect to the database with its local IP address 192.168.100.200.
The computers from internet can connect to the db with its forwarded port through the public IP address, 123.128.28.184.
Due to some coding circumstance, I can only connect to the database through public address when I'm in LAN. So I need the local clients to connect to the public IP address 123.128.28.184, but this seems not possible.
Network configuration is shown as in 1st picture.
The [?] connection returns error in 2nd picture.
How can I use my local client to connect to my database server through the public address?
Related
I've set a up a small SQL Server database on my laptop, I would like to access it from my Desktop PC, I'm a bit confused.
I've already Enabled TCP/IP protocols from SQL Server Configuration Mnagement, and I've already opened a port on the Windows Firewall and enabled remote connection on the database i want to connect to and added a login account to use for the connection.
From my desktop's SQLServer Managent instance,I've tried putting as ServerName, both the name I see on my laptop, (which I guess it's the local name of the machine) and the public IP adress + port, but nothing happens.
How do I get the two computers to communicate?
I am trying to connect to SQL Server (on Azure VM) from Azure Databricks. I tried connecting using Python and Scala, but failed to connect.
I get the error:
The TCP/IP connection to the host HOSTNAME, port 1433 has failed.
I used the code in the following link:
https://docs.databricks.com/data/data-sources/sql-databases.html
Both the SQL Server and the Databricks are on the same VNET.
I tried connecting to the SQL Server using "username" and "pwd" and I am able to connect from Management Studio on a Windows laptop.
val jdbcUrl = s"jdbc:sqlserver://${jdbcHostname}:${jdbcPort};database=${jdbcDatabase}"
I have the following details:
Server Name - ABCD\EFGH (this is what I use to connect from Management Studio on Windows)
IP Address
I am using the default port 1433
Fully qualified name - ABCD.lalaland.lala.lala.la
Database name
Username / pwd
What am I missing? What should the hostname be in JDBC URL? Should the instance name be included?
According to the Subnets reqirement, the virtual network must include two subnets dedicated to Azure Databricks: a private subnet and public subnet. As #samuelsaumanchan said, you can try enabling service endpoints on the vnet hosting both your sql server as well as your databricks instance. Service Endpoints enables private IP addresses in the VNet to reach the endpoint of an Azure service without needing a public IP address on the VNet.
I have to connect to a SQL Server. The problem is that I only can do it from my office because the server only accepts connections from my office's IP.
The question is: how can I connect to that server from my house?
Thanks
You (or your IT department) would have to set up a VPN to your office's IP address.
Internet browsing has suggested me following connection string to access remote DB, attached to remote SQL server.
"Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;"
I want to access the DB over internet, not over LAN.
My question is about the IP address and port.
1)What IP address I should use instead of 190.190.200.100? I mean how I can know what IP address my server has.
2) How to check the what port my server is using? Is it always 1433?
Thanks
I have two computers that share the same Internet IP address. Using one of the computers, I can remotely connect to a SQL Server database on the other. Here is my connection string:
SqlConnection connection = new SqlConnection(#"Data Source=192.168.1.101\SQLEXPRESSNI,1433;Network Library=DBMSSOCN;Initial Catalog=FirstDB;Persist Security Info=True;User ID=username;Password=password;");
192.168.1.101 is the server, SQLEXPRESSNI is the SQL Server instance name, and FirstDB is the name of the database.
Now, I have another computer with a different Internet IP address. I want to connect to the server above using the third computer that does not belong to my local area network. I dont have access to that third computer at the moment, so I want to use (if possible) the client computer in LAN again.
SqlConnection connection = new SqlConnection(#"Data Source=SharedInternetIP\SQLEXPRESSNI,1433;Network Library=DBMSSOCN;Initial Catalog=FirstDB;Persist Security Info=True;User ID=username;Password=password;");
Does not work
Note that I am a beginner, so I am not quite sure what I am doing even though I know what I want to do. By passing the Internet IP to the SqlConnection object rather than the local IP address, how can I successfully connect to the server computer, using the client computer in the same network? Also note that my ultimate goal is to connect to the server with an external client, but I don't have access to that computer right now. I'd appreciate any help.
SQL Server Express doesn't allow remote connection by default.
How to: Configure Express to accept remote connections
How to configure SQL Server 2005 to allow remote connections
Configuring SQL Server Express 2005 for Remote Access when SQL Server does not allow remote connections
Enable Remote Connection on SQL Server 2008 Express
or just enter "enable sql server express remote connection" in Google or Bing and you'll get gazillion of answers....