Sql server databases

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 ?

Hi @mohamedanouerbahloul ,

Can you take a few moments to explain your situation a little more fully? What were you trying to accomplish, what happened, and what was supposed to happen?

Sounds like a similar problem that I face. I have added MS SQL as a data source, but could only put “master” in the Database field and not say, “grafana1” which I have created in my MS SQL Server using SSMS.

I get a Login error: “Login error: mssql: Cannot open database “grafana1” that was requested by the login. Using the user default database “master” instead.”

I have the same issue here and as @jktansp said, if I change the database to master the connection works. Was anybody able to fix it?

Just found the issue in my case guys. I was trying to access a database which was in a different instance of the regular one and it seems that this is not possible, so when I tried a database in the default MSSQL instance, it worked.
Was working with the change to master database, because it existis in both instances.
There is workaround for that, but does not make sense in my case MSSQL Datasource: Connection to Named Instance not working

1 Like