Issue with connecting to SQL Server 2017 for Linux - sql-server

I have installed SQL Server 2017 on Linux Ubuntu together with SQL Command Line Tools.
Instantly after setting up and normal configuration I am unable to connect to it using the command line tools.
I am getting the following error:
How can I fix this issue?

I finally managed to fix the issue by reinstalling the SQL Server 2017 on my Debian machine.
Microsoft instructions are for Ubuntu not Debian but the only error I was getting on Debian was about OpenSSL which I solved it using the following answer:
https://askubuntu.com/questions/930712/installation-problems-with-ms-sql-server-for-linux
Now it works perfectly on my Debian machine.

Look here:
Configure a Windows Firewall for Database Engine Access
Configure a Server to Listen on a Specific TCP Port
Specifically:
Can not connect to MS SQL from Ubuntu sqlcmd
client
The fix for letting the Ubuntu client connect was to set "Listen to
All" to No in the SQL Server Configuration Manager > SQL Server
Network Configuration > Protocols for [instance name]. And under IP
Address change 127.0.0.1 to the [ip] used to connect. Don't forget to
restart the SQL Server!
Other tip: check your firewall (or temporaly disable it for testing).
Also allow remote connections in SQL Server properties > Connections.
See above posts.

Related

Unable to link SQL Server Express to SQL Server

I have a SQL Server version 12.0 instance installed on a Windows Server 2012R2 (SERVER/SQL), and a SQL Server Express version 11.0 instance installed on a windows 10 workstation (WIN10/SQLEXPRESS). Both are on the same domain. I am logged in as the domain admin and have full rights on both SQL instances.
On my WIN10 machine I am able to create a linked server from (WIN10/SQLEXPRESS) to (SERVER/SQL).
On my SERVER when I attempt to create a linked server from (SERVER/SQL) to (WIN10/SQLEXPRESS) I am told to ensure that the instance will allow for remote connections. I have gone through about 40 hours of troubleshooting this, ensuring that all firewalls, ports, security and agents and browsers are open.
Is there any reason I cannot link a SQL Server Express to another SQL Server, but can the other way around?
I would like to be able to call stored procedures from my main SQL Server but am not able to.
Please note, the purpose for the SQLEXPRESS on the WIN10 machine is due to the vendor requirements for the software I am using. Otherwise I would have the instance on my SERVER.
Almost certianly a network issue.
Using SQL Server Configuration Manager configure SQLEXPRESS to enable TCP/IP and listen on a fixed port, preferably 1433 if no other instance is on the server. Restart the instance.
Create a Windows Firewall rule enable inbound TCP/IP connections to the port.
Test network connectivity to the target port from the other server with powershell, eg:
PS C:\> test-netconnection WIN10 -Port 1433
Test SQL connectivity with SQLCMD or SSMS on the server to the WIN10 box.
Create the linked server.

Why I cannot connect to Linux MSSQL (SQLEXPRESS) from my Windows computer?

I just installed MSSQL on debian 8 (64bit) fallowing this steps on this link. It installs ok, no errors, I can also use sqsh -S localhost -U sa and it connects and I can execute SQL commands normaly. I choose to install SQLExpress license, so I suppose that instance name is "\SQLEXPRESS"
I install MSSQL server on my "mini computer" that is connected to my router (which sets DHCP). With other devices connected to this router I can ping this "mini computer" and also in other side, from "mini computer" I can ping other devices. All devices are in Workgroup, and not in Domain. Also I can connect with SSL to this "mini computer".
But If I want to connect from my Windows computer from Microsoft SQL Server Management Studio, I get error, that I cannot connect to this "mini computer": The parameter is incorrect! What I am doing wrong, is it possible to make connection like this, or I have to have domain server?
when you get a message :
the connection is established, but an existing connection was forcibly closed by the remote server
that means the connection is correct but this error could happen sometime for windows version, try it with other windows version and other SSMS version.

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.

MSSQL Server Remote Login Issue on Windows Server 2012 R2

I have installed MSSQL Express 2012 on Windows Server 2012 R2, I have set up database and logins. Everything works fine while I'm logged in at the server, but once I want to login from another machine I got the message:
"login failed for user sa".
Settings that I have made:
Added permission for port 1433 in Firewall,
Named Pipes,
TCP/IP,
VIA are enabled from Sql Server Configuration Manager.
Also for TCP/IP I have set IPALL - TCP Dynamic Ports (blank) and TCP Port 1433. ( These settings are used on other versions of windows that are working, but cant get it on Windows Server 2012 R2 when I want to connect from another machine ).
Thank you Larnu - I have just checked the instance name and it was another instace, because also on that machine was installed and older version and I was doing settings on that older version using that older Sql Server Configuration Manager.

Unable to connect to remote SQL Server 2008 R2 Express

I'm so frustrated I'm going to give all of my rep points if someone can help me with this.
Scenario:
There was a domain name change and the development server had a SQL Server Express working. Since I have forgotten the SA password and was not able to login with any account from the new domain I decided to uninstall and re-install a new SQL Server 2008 R2 Express.
I installed SQL Server Express from WPI with management studio. After the installation I can open the local server with Management Studio, but cannot open from a remote Management studio.
What I did to try to figure out WTH is going on:
I made sure Remote connection was checked on the SQL Options "Connections"
I enable TCP/IP and Named Pipe on SQL Server Configuration for my instance SQLEXPRESS
I ensure that the port was OK on Properties of TCP/IP of the SQL Server Configuration, there were no value at first, so I manual entered 1433, stop, start the server, try to connect.
a) I even try playing with the Active / Enable value, and with a stop, start, re-try in between every any changes.
Disable the Windows Server 2008 firewall, even added a manual rules for 1433.
Make sure the instance name was good on hkey_local..\software\ms\sql\... and the one I see on the local Management Studio, it's SQLEXPRESS
I can ping the server with its name or ip address, I even tried to connect with the IP address as well.
I'm just trying to connect from another server with another Management Studio, and here is the error I get:
Cannot connect to DEVSERVER\SQLEXPRESS.
ADDITIONAL INFORMATION:
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: 26 - Error Locating Server/Instance
Specified) (Microsoft SQL Server, Error: -1)
The server is a Windows Server 2008 x64
What a time waster
TIA for any tips, can't believe what's happening.
UPDATE:
I telnet from the remote server on port 80 just to make sure it's not a network problem, and I got HTML result, since firewall is disabled, and tcp/ip is enabled, SQL Browser started, Remote connection is activated it's hard to put the finger on what's not OK.
We had the same problem, finally figured out that a dynamic port entry has to be given along with the SQLExpress login .. ie 192.168.1.25\SQLEXPRESS,45490... then it allowed the login to happen.
We had installed a new SQLEXPRESS 2008 R2 (Windows 7 Professional Edition) in a new machine & was trying to connect to this DB from another machine from the mgmt studio and it was not connecting, nor was it connecting from any of the client machines.
We tried to check the SQLEXPRESS Browser / TCPIP was enabled and spent couple of hrs before we we figured out that the Dynamic port was causing this issue.
You can find this information, Open the SQLEXPRESS Configuration Manager, Select SQL Server Network Configuration on the left menu![Configuration Manager][1]
Select Protocol for SQLEXPRESS
You will find the TCPIP Enabled on the right side, click on the TCPIP and select properties
go to IPALL .. you will find the dynamic port info there.
btw, we tried installation on two HP PCs had the same issue & was solved with the dynamic port, while when we tried the installation on the ACer PC - did not get this dynamic port issue - so not really sure if it had anything to do with the OEM OS setup !?
However, the above solved our situation.
Last time this has happened to me, it was because I forgot about the SQL Server Browser service.
Did you try these steps: http://blogs.msdn.com/b/sqlexpress/archive/2005/05/05/415084.aspx ?
SQLEXPRESS is named instance, so it doesnt listen on 1433 port (it's for default instance). Try this:
Disable firewall
Start SQL Browser
Try to connect from remote machine
My problem solved by using the server configuration manager to disable the dynamic port (blank = disable), and fix the port to 1433

Resources