SQLSTATE[08001]: [Microsoft][ODBC Driver 13 for SQL Server]TCP Provider: No connection could be made because the target machine actively refused it

后端 未结 2 1005
北海茫月
北海茫月 2021-02-10 14:25

My doctrine repository code doesn\'t work, while I am able to access the database and read table data normally.

I get this stacktrace:

E         


        
相关标签:
2条回答
  • 2021-02-10 14:39

    For SQL Server 2019 Developer

    In default installation:

    • TCP/IP is disabled
    • Authentication is set to Windows Authentication mode only

    The Fix

    1. To enable TCP/IP:

      Start Menu
       -> Microsoft SQL Server 2019
       -> SQL Server 2019 Configuration Manager 
       -> SQL Server Network Configuration 
       -> Protocols For MSSQLSERVER 
       -> TCP/IP
       -> Enable
      
    2. To enable SQL Authentication mode:

       Start Menu
       -> Microsoft SQL Server Tools 
       -> Microsoft SQL Server Management Studio
       -> Right-Click the server node 
       -> Properties
       -> Security
       -> Under Authentication choose "SQL Server and Windows Authentication Mode"
      
    1. The above changes needs restarting the "MSSQLSERVER" service.
    0 讨论(0)
  • 2021-02-10 14:59

    Sql Server Configuration Manager -> Sql Server Network Configuration -> Protocols For -> TCP/IP ->

    I changed the following

    IpAll
    TCP Dynamic Ports 49226
    TCP Port
    

    To:

    IpAll
    TCP Dynamic Ports
    TCP Port          1433
    

    Not sure what TCP Dynamic Ports are and why they were configured.

    0 讨论(0)
提交回复
热议问题