Trying to connect to a Microsoft SQL Server on Pycharm

li9yvcax  于 2023-10-15  发布在  SQL Server
关注(0)|答案(1)|浏览(115)

I can't connect to the SQL Server, I have tried everything, chatgpt, Google and now I need your help

This is what I have have:

  • SQL Server is using Windows authentication and hostname/instant name (that shows up in SSMS as [PC-NAME]\SQLEXPRESS )
  • Host is localhost (I believe)
  • Tcp/ip is on for the server, I tried port 1433 and telnet to resolve the issue but no hope

I get this error
The TCP/IP connection to the host localhost, port 1433 has failed.

Error: "Connection refused: no further information. 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."

PS: I am fairly new so I don't know any techy term and just got started using Pycharm

EDIT: ChatGPT said to check my firewall for an inbound rule names 'SQL server Browser or related' But i did not find any rule related to SQL at all

guz6ccqo

guz6ccqo1#

Make sure your SQL Server browser is on and running, if not here's the procedure to do so

- Open your Server Configuration Manager and Click SQL Server Service 
 - Find 'SQL server Browser'
 - Right-Click and click on 'Properties' then go to
   Service
 - Click 'Start mode' and set it to either   
   Automatic/Manual(depending on your needs)
 - Click Apply and OK.
 - Restart the server(recommended).

There you go! SQL Server Browser is now Enabled!

If this doesnt work either your port might be block for which you need to add a new Inbound rule in your Firewall settings. Here's a link for it Click here

相关问题