- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试在 Linux - Debian 8.11 @ Virtualbox 上设置 MSSQL 数据库,但我无法通过 MSSQL MSSQL Server Management Studio 连接到它
服务器可 ping 通。
Reply from 192.168.56.101: bytes=32 time<1ms TTL=64
Reply from 192.168.56.101: bytes=32 time<1ms TTL=64
Reply from 192.168.56.101: bytes=32 time<1ms TTL=64
VirtualBox 中的网络设置:
仅主机网络VirtualBox Host-Only 以太网适配器
有什么想法吗?
TITLE: Connect to Server
------------------------------
Cannot connect to 192.168.56.101.
------------------------------
ADDITIONAL INFORMATION:
The connection to the server was successfully established, but an error occurred during the login process.
(provider: SSL Provider, error: 0 - The existing connection was sharply closed by the remote host.)
(Microsoft SQL Server, Error: 10054)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=10054&LinkId=20476
------------------------------
Connection Forcibly Closed by Remote Host
------------------------------
BUTTONS:
OK
------------------------------
Server Name: 192.168.56.101
Error Number: 10054
Severity: 20
State: 0
------------------------------
Program Location:
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)
at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()
服务器错误日志
2018-07-20 07:10:23.56 Server Microsoft SQL Server 2017 (RTM-CU9) (KB4341265) - 14.0.3030.27 (X64)
Jun 29 2018 18:02:47
Copyright (C) 2017 Microsoft Corporation
Developer Edition (64-bit) on Linux (Debian GNU/Linux 8 (jessie))
2018-07-20 07:10:23.57 Server UTC adjustment: -4:00
2018-07-20 07:10:23.57 Server (c) Microsoft Corporation.
2018-07-20 07:10:23.57 Server All rights reserved.
2018-07-20 07:10:23.57 Server Server process ID is 4120.
2018-07-20 07:10:23.57 Server Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.
2018-07-20 07:10:23.57 Server Registry startup parameters:
-d /var/opt/mssql/data/master.mdf
-l /var/opt/mssql/data/mastlog.ldf
-e /var/opt/mssql/log/errorlog
2018-07-20 07:10:23.58 Server SQL Server detected 1 sockets with 1 cores per socket and 1 logical processors per socket, 1 total logical processors; using 1 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
2018-07-20 07:10:23.58 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2018-07-20 07:10:23.58 Server Detected 1810 MB of RAM. This is an informational message; no user action is required.
2018-07-20 07:10:23.58 Server Using conventional memory in the memory manager.
2018-07-20 07:10:23.69 Server Buffer pool extension is already disabled. No action is necessary.
2018-07-20 07:10:23.76 Server InitializeExternalUserGroupSid failed. Implied authentication will be disabled.
2018-07-20 07:10:23.76 Server Implied authentication manager initialization failed. Implied authentication will be disabled.
2018-07-20 07:10:23.77 Server Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are [....]
2018-07-20 07:10:23.80 Server The maximum number of dedicated administrator connections for this instance is '1'
2018-07-20 07:10:23.80 Server Node configuration: node 0: CPU mask: 0x0000000000000001:0 Active CPU mask: 0x0000000000000001:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2018-07-20 07:10:23.81 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2018-07-20 07:10:23.82 Server In-Memory OLTP initialized on lowend machine.
2018-07-20 07:10:23.86 Server Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
2018-07-20 07:10:23.87 Server Query Store settings initialized with enabled = 1,
2018-07-20 07:10:23.87 spid6s Starting up database 'master'.
2018-07-20 07:10:23.89 Server Software Usage Metrics is disabled.
2018-07-20 07:10:24.22 spid6s Resource governor reconfiguration succeeded.
2018-07-20 07:10:24.23 spid6s SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2018-07-20 07:10:24.23 spid6s SQL Server Audit has started the audits. This is an informational message. No user action is required.
2018-07-20 07:10:24.31 spid6s SQL Trace ID 1 was started by login "sa".
2018-07-20 07:10:24.34 spid6s Server name is 'debian'. This is an informational message only. No user action is required.
2018-07-20 07:10:24.37 spid22s Always On: The availability replica manager is starting. This is an informational message only. No user action is required.
2018-07-20 07:10:24.38 spid9s Starting up database 'mssqlsystemresource'.
2018-07-20 07:10:24.38 spid22s Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required.
2018-07-20 07:10:24.38 spid23s Starting up database 'msdb'.
2018-07-20 07:10:24.38 spid9s The resource database build version is 14.00.3030. This is an informational message only. No user action is required.
2018-07-20 07:10:24.39 spid24s Starting up database 'debianIsAvaliable'.
2018-07-20 07:10:24.43 spid9s Starting up database 'model'.
2018-07-20 07:10:24.83 spid24s Parallel redo is started for database 'debianIsAvaliable' with worker pool size [1].
2018-07-20 07:10:24.94 spid9s Polybase feature disabled.
2018-07-20 07:10:24.94 spid9s Clearing tempdb database.
2018-07-20 07:10:24.98 spid6s Parallel redo is shutdown for database 'debianIsAvaliable' with worker pool size [1].
2018-07-20 07:10:25.29 spid19s A self-generated certificate was successfully loaded for encryption.
2018-07-20 07:10:25.31 spid19s Server is listening on [ 'any' <ipv6> 1433].
2018-07-20 07:10:25.31 spid19s Server is listening on [ 'any' <ipv4> 1433].
2018-07-20 07:10:25.32 Server Server is listening on [ ::1 <ipv6> 1434].
2018-07-20 07:10:25.32 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
2018-07-20 07:10:25.33 Server Dedicated admin connection support was established for listening locally on port 1434.
2018-07-20 07:10:25.35 spid19s SQL Server is now ready for client connections. This is an informational message; no user action is required.
2018-07-20 07:10:25.50 spid9s Starting up database 'tempdb'.
2018-07-20 07:10:25.76 spid9s The tempdb database has 1 data file(s).
2018-07-20 07:10:25.77 spid22s The Service Broker endpoint is in disabled or stopped state.
2018-07-20 07:10:25.78 spid22s The Database Mirroring endpoint is in disabled or stopped state.
2018-07-20 07:10:25.79 spid22s Service Broker manager has started.
2018-07-20 07:10:25.80 spid6s Recovery is complete. This is an informational message only. No user action is required.
Microsoft (R) SQLServerAgent 14.0.3030.27
Copyright (C) 2017 Microsoft Corporation. All rights reserved.
SQLAgent is disabled
SQLAgent is exiting
● mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled)
Active: active (running) since Fri 2018-07-20 07:10:16 EDT; 9min ago
Docs: https://learn.microsoft.com/en-us/sql/linux
Main PID: 418 (sqlservr)
CGroup: /system.slice/mssql-server.service
├─418 /opt/mssql/bin/sqlservr
└─805 /opt/mssql/bin/sqlservr
最佳答案
解决方法:
安装docker
为您的 .NET Core 应用创建连接字符串
将其输入到 appsettings.json
例如 "DefaultConnection": "Server=IP; Database=Test; User=sa; Password=Password;"
其中 IP = 例如 172.17.0.5,您可以使用 docker inspect name
找到它命令
另外
密码是您在创建该 docker(docker run 命令)时定义的 SA 密码。在 MS 的教程中是 <YourStrong!Passw0rd>
您不必创建数据库,例如测试,因为 EntityFramework 应该这样做。 (对此我不是 100% 确定,但这就是它对我的影响)
在 Virtualbox 机器中使用“host-only”网络设置使您的应用程序对主机可见(对我来说是 windows)
此外,您可能必须添加 nginx + 创建反向代理,例如 http://piotrgankiewicz.com/2017/06/12/asp-net-core-deployment-using-docker-nginx-and-ubuntu-server/#more-3847
祝你好运
其他可能有用的链接:
关于sql-server - 从 Windows 连接到 Debian MSSQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51440986/
我正在开发一个 voip 调用应用程序。我需要做的是在接到来电时将 Activity 带到前台。我在应用程序中使用 Twilio,并在收到推送消息时开始调用。 问题是我试图在接到任何电话时显示 Act
我是一名优秀的程序员,十分优秀!