【发布时间】:2019-04-30 22:42:47
【问题描述】:
我将 Serilog 添加到我的应用程序中,并且控制台接收器运行良好。然后我将 MySQL 接收器添加到配置中。我的设置是:
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.MySQL" ],
"MinimumLevel": "Debug",
"WriteTo": [
{ "Name": "Console" },
{
"Name": "MySQL",
"Args": {
"connectionString": "server=<server>;uid=<username>;pwd=<password>;database=logging_database",
"tableName": "logging",
"storeTimestampInUtc": true
}
}
],
}
我可以使用 phpMyAdmin 访问数据库,所以我知道它正在工作。
我得到的错误是:
Error: 0 : Unable to connect to any of the specified MySQL hosts.
有没有人看到或知道如何解决它????
【问题讨论】: