win server 2008 r2 .net core webapi mysql安装配置遇到诸多难题:
问题一:提示【Failed to load the dll from [C:\Program Files\dotnet\host\fxr\1.0.1\hostfxr.dll], HRESULT: 0x80070057】错误
解决方案:需要安装补丁:KB2533623 ,注意选择win server 2008 r2 下载地址:https://support.microsoft.com/en-us/kb/2533623
问题二:用数据库指定用户(非root)连接mysql提示:(failed)net::ERR_CONNECTION_RESET,返回值为空白,并且返回的200状态,原因是数据库连接问题,
解决办法:将localhost添加到指定用户里。
1 2 3 4 5 6 7 8 9 10 11 |
{ "ConnectionStrings": { "DefaultConnection": "Server=localhost;Database=schooldb;User=schooldb;Password=whd0509;" }, "Logging": { "LogLevel": { "Default": "Warning" } }, "AllowedHosts": "*" } |
.net core web api appsettings mysql数据库连接字符串
到此一切正常了,另外生产环境记得安装hosting和.net core sdk
MySQL 服务名已经存在
2023-11-30 上午11:50Cmd管理员删除服务:
sc delete mysql56