Connecting Grafana data source with sql server mangement studio

Hello, I have sqlexpress running in sql server management studio and i cannot connect both data source in Grafana with SQL Server Management Studio? I get error:
Unable to open tcp connection with host ‘localhost:1433’: dial tcp 127.0.0.1:1433: connect: connection refused
Where am I going wrong?
Thanks

Hi,

Make sure you are using the correct port and also that your instances of SQL are listening on localhost.

You can try on your powershell :

telnet localhost 1433

It should work.

Hope it helps.

Good Luck

Hello.

Thanks, when I use telnet I just get a blinker and nothing happens?

Also i am using the web version? Are web and local version same?

Hi,

When you say the web version, are you referring to Grafana Cloud ?

Yes i.e add data source (SQL Server) => SQL Server Studio Manager (local)

So for hostname i use 192.168.0.14, Datbase name, user id, password and get:

Unable to open tcp connection with host ‘192.168.0.14:1433’: dial tcp 192.168.0.14:1433: i/o timeout

Hi,

Ok I see now, first thing you must check what is your real IP address (from your router) go to :

Use your ipv4 IP address, second thing is you should allow access to this port (check if there is any firewall preventing this).

Hope it helps

When I use telnet, both firewall off or on I get failed connection to port 23 when I use: telnet 192.168.0.14 1433

192.168.0.14 is my ipv4 IP address

I have added IPALL in SSMS as 1433

Hi,

Your public ip cannot be 192…, did you check on the website ?

Type : netstat -a

Your port should show listening.

Which one is SQL Server:

TCP 127.0.0.1:64284 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:64427 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:64433 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:64727 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:64729 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:64766 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:64768 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:64869 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:64894 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:64946 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:64952 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:65140 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:65145 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:65289 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:65293 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:65521 DESKTOP-TNR2K3N:0 LISTENING
TCP 127.0.0.1:65526 DESKTOP-TNR2K3N:0 LISTENING
TCP 172.17.225.17:139 DESKTOP-TNR2K3N:0 LISTENING
TCP 192.168.0.12:139 DESKTOP-TNR2K3N:0 LISTENING

Hi,

Try :

SELECT DISTINCT 
    local_tcp_port 
FROM sys.dm_exec_connections 
WHERE local_tcp_port IS NOT NULL 

Then you should find the pid of your instance and look if it’s listening.

Check this page :

Thanks bro, very grateful for this, I get port for ipv4 either 1433 or 56229, which one as they have ID’s spid20s for both?

That code didn’t work, I used FYI:
USE GeneralTestAutomation
GO
xp_readerrorlog 0, 1, N’Server is listening on’
GO

Also am assuming ipaddress is localhost? So localhost:1433 or localhost:56229

Hello, I don’t know why grafana can’t attached myDB, but it can connect to systemDB like master
this is the error “Login error: mssql: Cannot open database “myDB” that was requested by the login. Using the user default database “master” instead.”
any idea ?