MSSQL Connecting to database timeout error

What Grafana version and what operating system I am using?
Windows 10 & Grafana Version 9.3.6

What am I trying to achieve?
Tring to connect mssql database.
This is a on-premise sql server. and i connecting this sql server remotely, which mean this db is not hosted in my pc.

How are you trying to achieve it?
there is some issue of this server, we will always need to increase the timeout to 60second while connecting this db.
I am trying to connect this db on datasource configuration. I increased the timeout to above 1 minute.

  • What happened?
    No matter what number i fill in the input section of connection timeout, the result always 15 seconds timeout. (from Grafana log details)

Please refer to the following picture, in this case i changed the timeout to above 1 minute, it’s still unable to connect to database. I checked the log details. the timeout only 15 seconds which is not matched to what I set.

you have windows authentication. which user are you using to connect to mssql ?

Yea window authentication. It is based on window log in user. So we no need to input username and password. It is common practice of window authentication. The problem is I increase the timeout to 100 second but end up it is still maintained 15 seconds timeout . That why the connection failed.
Seen like the default connection timeout to database is 15second.

Temporarily try a sql login and see if it times out or not

this is equipment database. this db is hosted in server in our server room. I am not the server admin, i am only the database level admin. we are only allowed to connect to any application via Window Authentication. I just want to know how to increase connection timeout to database. it looks like the connection timeout input doesn’t work for it.

Any other method to increase timeout even from the source code. i am using open source version. Thank you very much

the issue might not be a timeout issue. How and where have you configured the windows authentication?

I just choose window authentication from sql server data source screen.
I am pretty sure that this db can’t connect due to db connect time-out.

Grafana Log path: C:\Program Files\GrafanaLabs\grafana\data\log

As I said previously, it always takes about a minute for the db connection to be established.
it is same to how i connect this db via SSMS: increase the timeout.

But you can see from my second screenshot, the connection duration only 15.007sec even i set it to 100 second which is not matched.

so you have single sign on windows users? and all users have permission to the db?

yes i have the permission to the db. This is how i connect this instance. normally i will set connection time-out to 120 second.


But in Grafana, it’s looks like can’t increase the timeout. it will always maintain 15 second timeout even i set it to 100 second.

Is your grafana configured for single sign on?

No… no SSO, i am using default admin account for grafana

you cannot use that see the documentation

This is another server, seen it can connect via window authentication.
I am very sure the problem come from connection timeout. I just want to extend the connection timeout… above 15 second.

1 Like

Any solution for this?

I would say improve the query? can you show the query that take more than 15s

That is no the query, that is the database connection, I not even can connect my database using Grafana

1 Like