I'm having all kinds of trouble getting IBM WebSphere 8.5 to connect to my SQL Server 2012 data source. I have the URL of jdbc:sqlserver://localhost;userName=user;password=password. See the following error (I know it's kind of long):
The test connection operation failed for data source reachingrecovery on server server1
at node MWEISS7X16Node01 with the following exception: java.sql.SQLException: The TCP/IP
connection to the host localhost, port 1433 has failed. Error: "Connection refused:
connect. Verify the connection properties. Make sure that an instance of SQL Server is
running on the host and accepting TCP/IP connections at the port. Make sure that TCP
connections to the port are not blocked by a firewall."
Now, the SQL server and WebSphere are running on the same machine, so I don't think it's a firewall issue. I've checked the SQL server properties under "Connections", and it indicates that everything is fine ("Allow remote connections to the server" is checked.)
I'm at a loss to understand why this is happening. Any suggestions? Thx Mimi
I found out what the problem was. I was using SQL Server Management Studio to check on whether it could make TCP/IP connections or not. What I should have been using was SQL Server Configuration Manager. It had a thing on the left called "SQL Server Network Configuration". I clicked on that, and it brought up "Protocols for server instance name". It had a thing on the right (TCP/IP), which indicated it was disabled. I enabled that, restarted the SQL server, and it worked.
Related
I'm attempting to connect to a test Database on a Parallels VM on Mac using Azure Data Studio, but I'm getting the standard, generic connection error:
System.Data.SqlClient.SqlException (0x80131904): 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: TCP Provider, error: 40 - Could
not open a connection to SQL Server)
Steps I've taken so far to open the connection include:
Opening port 1433 through windows firewall
Ensuring remote connections are allowed on the SQL instance
Setting the TCP/IP Protocol to 5171 for IPAll
Running SQL Server and SQL Browser Instances
Adding a rule to windows firewall for sqlservr.exe to allow all connections
Enabling the SA account and adding a password (password is correct - I've double checked in SSMS on the VM)
I'm able to connect from the windows VM but not the Mac.
My connection string is below (IP is correct, again I've double checked):
Is there a step I've missed or some extra config that I need to do on the VM itself maybe? Or maybe the connection string isn't quite right? I've also tried using the Machine Alias to connect to the instance (SQLEXPRESS) - but still no joy. Anyone know what the problem might be because it's driving me crazy and I can see that other devs have made it work, so I know it's possible. My version of Parallels is Desktop 15, I don't know if that makes a difference or not?
Ok so turns out I needed to open the IPAll port I had set for the TCP/IP Config which in my case was 5171 as well as adding a rule to allow SQL Server Browser to connect to the internet.
For those of whom the above method doesn't work, try Bridged Network instead of Shared Networking in the Network settings and replace the old IP address with the new one.
I am able to connect to Microsoft SQL Server (in Parallels Desktop 16) using Visual Studio Code in macOS Big Sur.
I am having an issue connecting to my SQL Server Database remotely from another computer.
I am trying to connect to the database using a VB.Net application that is suppose to be able to interact with it. I'd say my connection string may be the issue, but I have no problem connecting on the machine the database is on using the connection string.
This is what the connection string looks like though:
"Data Source=[IP_ADDRESS],[PORT];Network Library=DBMSSOCN;Initial Catalog=SQL_Database;Persist Security Info=True;User ID=[USER];Password=[PASS]"
The error I am getting right now is:
Database 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: TCP Provider. error: 0 - The wait operation timed out.).
This is what I have done so far to try to get this to work:
I have made sure that the files being run are on not a network/shared drive.
I've added an exception for TCP Port 1433 and UDP Port 1434 as Incoming Rules to the Firewall.
I've tried disabling the firewall.
I have gone into SQL Server Configuration Manager to ensured that the TCP settings are setup properly.
One thing I am not sure about, is that in the Configuration Manager, I have both the SQL Server and SQL Server Browser running, but the SQL Server Agent is unable to start. Would this cause me my problem?
If not, what else could be my issue? I need to be able to access this database remotely, but the connection string seems to only work locally.
So the issue was literally my company's installed network Firewall. Apparently when I asked if the firewall had been put down for me to test this, "Yes" really meant "No". Once I got the firewall temporarily disabled I was able to connect to everything perfectly fine.
I am trying to connect to my local SQL DB through AnyLogic 7.3.6. I have SQL Server 2016 Developer installed and the DB is in mixed authentication (Windows & SQL). When adding the connection it gives the following error:
Network error IOException: Connection refused: connect
Connection refused: connect
My host is called localhost. I have tried leaving Login and Password blank, hoping for Windows Authentication, and I've tried adding a SQL user (Test, test) to the server, both to the same result. I am using the com.microsoft.sqlserver.jdbc.SQL.ServerDriver JDBC driver, but have also tried net.sourceforge.jtds.jdbc.Driver (same result).
Can anyone explain how I can make a connection between AnyLogic 7 and SQL Server 2016 (Developer)?
I don't think the Windows Authentication will work with AnyLogic. So make sure to have a correct configured SQL User to use.
Make sure that "Allow remote connections to this server" is enabled. Open SQL Server Management Studio -> Right click on your instance -> Properties -> Connections.
Check so TCP/IP connections are enabled. Open SQL Server Configuration Manager -> SQL Server Network Confinguration -> Select your instance -> Enable TCP/IP. It's also possible to change the default port here.
The TCP/IP connection is using port 1433 as default. Make sure to allow connections through this port in your firewall.
I forwarded port 1433 to 9082 on my server, at firewall set to allow for inbound and outbound, at SQL Server Allow Remote is ON.
But, I can't connect to my SQL Server from client.
I installed SQL Server 2012.
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: 25 - Connection string is not valid)
Solution to problems connecting to MS SQL server with Microsoft SQL Server Management Studio if your port is forwarded
I had problem with this as well. It's been bugging me for days now. Finally I stumbled on solution on this page so I'll exclude it as screenshot:
It's not : like in all other systems, you have to put ,
First off check in the ERRORLOG the port used by SQL Server (there is no guarantee it will always listen on 1433, or if TCP is enabled at all).
In the ERRORLOG, at startup, you will find a line like this one:
In my case the port is indeed 1433 but yours may be different. If needed, you can change it using the SQL Server Configuration Manager.
Secondly, if you are forwarding a port to a different one (like your example from 1433 to 9082) you are in fact disabling the SQL Server Browser. This happens because SQL Server Browser does not know of your port forward so it will tell the clients to connect to 1433 (supposing you are allowing UDP 1434 otherwise you won't be able to reach SQL Server Browser at all).
You can connect to a SQL Instance without using the SQL Server Browser though, all you need is to specify the port in the connection string (without the instance name, if any).
For example, if your instance is called MYSERVER/INST your connection string will be something like:
User ID=*****;Password=*****;server=tcp:MYSERVER,9082
Also make sure to configure your SPNs manually otherwise Kerberos won't work.
You can find more details on how to compose the right connection string here: SqlConnection.ConnectionString Property.
try config your router first. after all connect. Btw, already enable TCP/IP #sql yet or not?make sure open port for sql.
check on sql configuration enable or not for open connection
check firewall open or not
check router open or not
check connection lag or not(if network). local no need
make sure sql browser and agent run(for xp if not xp just enable sql browser)
if not all there maybe you wrong installation. if for network work install local/system. not network(this for attach #server cluster)
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