locked
Problem to connect RRS feed

  • Question

  • Dear,
    I've enabled TCP port 61240 on server but I've still got

    TITLE: Connect to Server
    ------------------------------
    
    Cannot connect to WIN-APIUFD1NJEU,61240.
    
    ------------------------------
    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: TCP Provider, error: 0 - The wait operation timed out.) (Microsoft SQL Server, Error: 258)
    
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=258&LinkId=20476
    
    ------------------------------
    
    The wait operation timed out
    
    ------------------------------
    BUTTONS:
    
    OK
    ------------------------------



    why?

    Many Thanks & Best Regards, Hua Min

    Wednesday, October 3, 2018 4:22 AM

Answers

  • And how are we supposed to know why you get this error? For all I care, there may not be any SQL Server installed on WIN-APIUFD1NJEU. And if there is, it may not be listening on port 61240.

    So in answer to your question "why?", I would say "why not?".

    You could at least have made the effort to share the information why you think this should be working in the first place.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Marked as answer by Jackson_1990 Friday, October 5, 2018 1:31 AM
    Wednesday, October 3, 2018 7:24 AM

All replies

  • Hi there,

    you need to open this port on the windows firewall.

    create an inbound rule for this port.

    good luck

    kumar

    Wednesday, October 3, 2018 5:41 AM
  • Yes, I opened the port already.

    Many Thanks & Best Regards, Hua Min

    Wednesday, October 3, 2018 6:41 AM
  • Yes, I opened the port already.

    Many Thanks & Best Regards, Hua Min

    First check if the SQLServer and SQLBrowser service is up and running and you can connect to the instance locally from SSMS

    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Wednesday, October 3, 2018 6:54 AM
  • Everything is fine to SQL server on server machine.

    Many Thanks & Best Regards, Hua Min

    Wednesday, October 3, 2018 7:03 AM
  • did you rename the Server

    Ramesh Babu Vavilla MCTS,MSBI

    Wednesday, October 3, 2018 7:07 AM
  • And how are we supposed to know why you get this error? For all I care, there may not be any SQL Server installed on WIN-APIUFD1NJEU. And if there is, it may not be listening on port 61240.

    So in answer to your question "why?", I would say "why not?".

    You could at least have made the effort to share the information why you think this should be working in the first place.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Marked as answer by Jackson_1990 Friday, October 5, 2018 1:31 AM
    Wednesday, October 3, 2018 7:24 AM
  • Everything is fine to SQL server on server machine.

    Many Thanks & Best Regards, Hua Min

    Can you check if TCP port is opened for inbound connections using telnet?

    https://www.acronis.com/en-us/articles/telnet/


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Wednesday, October 3, 2018 7:38 AM
  • And how are we supposed to know why you get this error? For all I care, there may not be any SQL Server installed on WIN-APIUFD1NJEU. And if there is, it may not be listening on port 61240.

    So in answer to your question "why?", I would say "why not?".

    You could at least have made the effort to share the information why you think this should be working in the first place.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    How to ensure that machine is listening on 61240 (I've already enabled Firewall Inbound TCP rule on this port)?

    Many Thanks & Best Regards, Hua Min

    Wednesday, October 3, 2018 8:04 AM
  • And how are we supposed to know why you get this error? For all I care, there may not be any SQL Server installed on WIN-APIUFD1NJEU. And if there is, it may not be listening on port 61240.

    So in answer to your question "why?", I would say "why not?".

    You could at least have made the effort to share the information why you think this should be working in the first place.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    How to ensure that machine is listening on 61240 (I've already enabled Firewall Inbound TCP rule on this port)?

    Many Thanks & Best Regards, Hua Min

    check with telnet if the post is open

    https://www.acronis.com/en-us/articles/telnet/


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Wednesday, October 3, 2018 8:08 AM
  • What to adjust (on server)?
    C:\Users\Administrator>telnet WIN-APIUFD1NJEU 61240
    Connecting To WIN-APIUFD1NJEU...Could not open connection to the host, on port 61240: Connect failed



    Many Thanks & Best Regards, Hua Min

    Wednesday, October 3, 2018 8:40 AM
  • Some anti-virus software also would block network connection, please check the av settings in your database server if it has.
    Wednesday, October 3, 2018 8:53 AM
  • What to adjust on DB server as there is no specific anti-virus software installed?

    Many Thanks & Best Regards, Hua Min

    Wednesday, October 3, 2018 8:56 AM
  • Hi HuaMin,

     

    Could you please try to ping the server IP address of the server. And I'll appreciate that you can provide us the screenshot of the result. If it doesn't work, then it indicates a general TCP configuration problem. Because connecting to SQL Server by using TCP/IP requires that Windows can establish the connection. You can refer to the document to troubleshooting TCP/IP.

     

    If the ping test succeeded using the IP address, next test that the computer name can be resolved to the TCP/IP address. On client computer command prompt, please ping the computer name of the that is running SQL Server. If it will receive error, you might have old (stale) name resolution information cached on the client computer. Type ipconfig /flushdns to clear the DNS (Dynamic Name Resolution) cache.

     

    For more detailed information, you can refer to the document. https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/troubleshoot-connecting-to-the-sql-server-database-engine?view=sql-server-2017#testing-tcpip-connectivity

     

    Best Regards,

    Emily


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, October 3, 2018 9:34 AM
  • How to ensure that machine is listening on 61240 (I've already enabled Firewall Inbound TCP rule on this port)?

    Again, we don't know why you think there would be an SQL Server instance listening on port 61240.

    You can see which ports (if any) SQL Server is listening on in the first hundred lines or so in the SQL Server errorlog.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Wednesday, October 3, 2018 11:07 AM
  • Hi There,

    is this a default instance or did you gave name to the instance.

    open the configuration manager and find your instance name. use the below link

    https://learningsqlserver.wordpress.com/2011/01/21/what-version-of-sql-server-do-i-have/

    if it is a named instance then you need to chnage the connection string as below

    WIN-APIUFD1NJEU\{instance name},61240

    good luck

    kumar

    Thursday, October 4, 2018 12:54 AM
  • You can see which ports (if any) SQL Server is listening on in the first hundred lines or so in the SQL Server errorlog.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    What to check?

    Many Thanks & Best Regards, Hua Min

    Thursday, October 4, 2018 1:27 AM

  • What to check?

    We would like to know what port SQL Server instance is listening on. You mentioned you "enabled TCP port on server", but do you mean you changed the port the SQL listens on? To verify, go to SQL Server configuration manager-->SQL Network Configuration-->Protocols for <YourInstance>-->Right-click TCP/IP-->Properties-->Under the IP addresses tab check the last "IPAll" section. See if you see the port 61240 under dynamic port.

    See this for GUI instructions. 

    Connect as Kumar suggested in his above reply and see how it goes.


    Please remember to click "Mark as Answer" if my response answered your question or click "Vote as helpful" if it helped you in any way.

    Thursday, October 4, 2018 1:55 AM
  • Can you open sql server management studio inside the database server machine, then connect to the sql instance, by specifying the server name as TCP:WIN-APIUFD1NJEU,61240 ? Your uploaded photo is too small, but I think you should set the port number in the lowest part under "IPAll".
    Thursday, October 4, 2018 3:32 AM
  • Have you restarted SQL Server after you made the port changes; it's required to take effect? Check start sequency of ErrorLog, there should be an entry like "Server is listening on [ 192.168.0.1 <ipv4> 61240]."

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Thursday, October 4, 2018 5:48 AM
  • Yes, I did restart the services of SQL server. Where is such log?

    Many Thanks & Best Regards, Hua Min

    Thursday, October 4, 2018 6:33 AM
  • Check start sequency of ErrorLog, there should be an entry like "Server is listening on [ 192.168.0.1 <ipv4> 61240]."

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Here is what I've got


    Many Thanks & Best Regards, Hua Min

    Thursday, October 4, 2018 7:04 AM
  • Check start sequency of ErrorLog, there should be an entry like "Server is listening on [ 192.168.0.1 <ipv4> 61240]."


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Here is what I've got


    Many Thanks & Best Regards, Hua Min

    This suggests its using port 59365

    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Thursday, October 4, 2018 7:06 AM
  • But that's port 59365, not 61240 as you wrote before.

    Olaf Helper

    [ Blog] [ Xing] [ MVP]


    Thursday, October 4, 2018 7:07 AM
  • Yes, I have changed the port but I still have got the same issue when connecting to

    WIN-APIUFD1NJEU\SS2012EXPR,59365
    &
    WIN-APIUFD1NJEU,59365

    Many Thanks & Best Regards, Hua Min

    Thursday, October 4, 2018 7:16 AM
  • Yes, I have changed the port but I still have got the same issue when connecting to

    WIN-APIUFD1NJEU\SS2012EXPR,59365
    &
    WIN-APIUFD1NJEU,59365

    Many Thanks & Best Regards, Hua Min

    telnet is failing?

    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Thursday, October 4, 2018 7:27 AM

  • telnet is failing?

    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Yes.

    Many Thanks & Best Regards, Hua Min

    Thursday, October 4, 2018 7:33 AM
  • Hi HuaMin,

     

    If you want to use the 59365 port, have you changed the TCP port in the Sql Server Configuration Manager like the following screenshot.

     

     

     

    Besides, could you please check the firewall in server side, and open the 59365 port.

     

    Best Regards,

    Emily


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, October 4, 2018 9:02 AM
  • I have

    but I still have the same problem.


    Many Thanks & Best Regards, Hua Min

    Thursday, October 4, 2018 1:06 PM
  • I have

    but I still have the same problem.


    Many Thanks & Best Regards, Hua Min

    Why is TCP Dynamic Ports set to 0 . It means instance will be listening on dynamic ports

    Just remove the 0 and save and then try connecting it

    Also I hope you set Listen All property to Yes in the Protocol tab


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Thursday, October 4, 2018 1:21 PM
  • Dynamic port does change by itself while I have originally put 59365. It seems it would not keep one specific number to Dynamic port.


    Many Thanks & Best Regards, Hua Min


    Thursday, October 4, 2018 1:40 PM
  • Dynamic port does change by itself while I have originally put 59365. It seems it would not keep one specific number to Dynamic port.


    Many Thanks & Best Regards, Hua Min


    Sorry I'm getting confused

    If you want instance to use static port always then you need to leave TCP Dynamic Ports property to blank for all IPs and set required port number under TCP Port property


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Thursday, October 4, 2018 1:43 PM
  • Even if I've left blank to Dynamic port, I still have got the same problem after having restarted SQL server services.

    Many Thanks & Best Regards, Hua Min

    Thursday, October 4, 2018 1:45 PM
  • So did you update the settings in the firewall, efter the revelation that SQL Server was listening on a different port than you thought?

    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Thursday, October 4, 2018 9:14 PM