首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >db查询错误:连接服务器失败-请查看Grafana服务器日志以获得详细信息。

db查询错误:连接服务器失败-请查看Grafana服务器日志以获得详细信息。
EN

Stack Overflow用户
提问于 2021-08-26 11:35:34
回答 2查看 12.4K关注 0票数 0

我是Grafana的新手,并试图将Grafana连接到。我使用Windows操作系统在同一台机器上运行Grafana和SQL server。在Grafana中,我选择了Server数据源,并提供了主机和数据库名称。我在server中创建了一个用户,并按照https://grafana.com/docs/grafana/latest/datasources/mssql/向用户授予了读取器权限。无论是对于server身份验证还是Windows,我都会得到错误db query error: failed to connect to server - please inspect Grafana server log for details。我检查了Grafana日志文件:lvl=eror msg="query error" logger=tsdb.mssql err="Unable to open tcp connection with host 'servername:1433': dial tcp [2a02:908:1391:9e80:c180:xxxx:xxxx:xxxx]:1433: connectex: No connection could be made because the target machine actively refused it." --如何强制SQL server授予对Grafana的访问权限?

我应该说,我没有更改Grafana conf文件。我需要更改默认的conf还是创建另一个conf文件?Grafana conf文件中的默认DB配置是:

代码语言:javascript
复制
[database]
# You can configure the database connection by specifying type, host, name, user and password
# as separate properties or as on string using the url property.

# Either "mysql", "postgres" or "sqlite3", it's your choice
type = sqlite3
host = 127.0.0.1:3306
name = grafana
user = root
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
password =
# Use either URL or the previous fields to configure the database
# Example: mysql://user:secret@host:port/database
url =

# Max idle conn setting default is 2
max_idle_conn = 2

# Max conn setting default is 0 (mean not set)
max_open_conn =

# Connection Max Lifetime default is 14400 (means 14400 seconds or 4 hours)
conn_max_lifetime = 14400

# Set to true to log the sql calls and execution times.
log_queries =

# For "postgres", use either "disable", "require" or "verify-full"
# For "mysql", use either "true", "false", or "skip-verify".
ssl_mode = disable

# Database drivers may support different transaction isolation levels.
# Currently, only "mysql" driver supports isolation levels.
# If the value is empty - driver's default isolation level is applied.
# For "mysql" use "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ" or "SERIALIZABLE".
isolation_level =

ca_cert_path =
client_key_path =
client_cert_path =
server_cert_name =

# For "sqlite3" only, path relative to data_path setting
path = grafana.db

# For "sqlite3" only. cache mode setting used for connecting to the database
cache_mode = private
EN

回答 2

Stack Overflow用户

发布于 2021-08-31 08:04:44

Grafana的配置文件中的设置引用其内部数据库,因此您不需要更改其中任何一个来连接到MS。

Authentication

  • Make

  • 尝试使用"localhost“或"127.0.0.1”作为主机名

  • ,确保身份验证是Server,确保加密是假的

  • 检查server日志中是否有

错误

票数 2
EN

Stack Overflow用户

发布于 2022-08-05 04:43:33

使用计算机IP地址的Docker主机遵循以下步骤:

打开CMD

  • IPCONFIG /ALL

  • Look用于WiFivEtherner下的IPV4地址;在我的示例中,是192.168.1.24172.45.202.1,respectively

  • Then尝试访问托管在带有映射端口的Docker容器中的应用程序(例如,1433/5436)

  • It简单地使用192.168.1.24:1433172.45.202.1:1433访问所有使用DockerH 221G 222托管的容器应用程序
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68937795

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档