Connect to Sql Server on Win 10 from macbook - sql-server

I have SQL Server running on my Windows 10 laptop and I would like to connect to my databases on this server from my macbook.
I have enabled the network access for the SQL Server and have added a SQL login.
After this what other steps should I be taking to connect to the DB?

First make sure your macbook is connect to the server pc with valid ip address,create one user in server with privileges(it depend on your how much access you have to give other user), after that use connection string with created user id and password,mention correct ip addreess in connection string.
String connection = "server= 'ip address of server pc';user id='user_name';database='database_name';password='password'";

Related

Instance name/default instance

I have SQL Server Express running on machine GERSWHIN. On GERSHWIN itself, SSMS connects using: GERSWHIN\SQLEXPRESS.
The server is running on port 1344, and from the Internet, I can telnet into GERSHWIN, exposed as, say, abc.com, on port 1344.
From another computer using SSMS, what should be the string to use in the Server name field to connect to this SQL Server?
I tried abc.com:1344 and abc.com:1344\SQLEXPRESS but both got the same error:

Getting Server Name Right - Microsoft SQL Server Management Studio 17

I have a remote Windows Server 2017 with MS SQL Server and I want to connect with it remotely from my machine (but currently I'm unable to).
First of all I want to ask if I get the IP address right (or rather Server Name field in SQL Server prompt in MS SQL Server Management Studio)
mentioned server name field
Let's say IP of the remote server is 135.150.96.96. The instance of the SQL Server on remote server is "TEST". The port is 63011. If I'm one of admins on remote server I assume this server works all the time for all users.
135.150.96.96\TEST,63011
Is this address correct?
I know there are more things to check (services, firewall etc.) that's why I want to be sure I type server name correctly.

Connecting to a local SQL Server database

While making web.config, I tried to connect local SQL Server database with the web
<add key="DSN" value="server=localhost;uid=test_demo;pwd=1234;database=DB_PRE"/>
However using "DSN" with value server = localhost does not successfully connected to the local SQL Server database. And I'm not sure with creating uid and pwd I want to know how to use "DSN" to connect to the local.
I'm using SQL Server 2008, IIS Express 7.
So it was port number problem at first, designating the initial(base) port number for the Database server, and the password policy should be turn off.
Password policy required me to change password regularly after some amount of time, and this was the error which is really hard to find

Why can I not connect to SQL Server using server name, but works with IP Address?

So, I have two PC (PC-A and PC-B) that I've set up with Windows 7 and SQL Server 2012. I setup a port forwarding for PC-A so I can access it remotely.
I can connect to SQL Server on PC-A from PC-B (using SQL Server Management Studio) by entering the PC-A ip address, but unable to connect if I'm using the server name of SQL Server on the PC-A.
Any ideas to make it works?
Try using tcp:[Server Name],1433
1433 is the default port numberused by sql server
Found a workaround to this problem. I install hamachi on both PCs, register them to a same hamachi network. And now I can connect using the server name.
Thanks all for the suggestions.

Remote connection to SQL Server Express fails

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....

Resources