当前位置: 首页 > 知识库问答 >
问题:

从Windows连接到Debian MSSQL

爱唯
2023-03-14

我正在尝试在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纯主机以太网适配器

有什么想法吗?

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()

错误日志@服务器

https://pastebin.com/7WGEVg1a

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://docs.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

共有1个答案

子车文康
2023-03-14

解决方法:

>

按照以下说明操作:https://docs.microsoft.com/pl-pl/sql/linux/quickstart-install-connect-docker?view=sql-server-linux-2017

为你的.NET核心应用程序创建连接字符串

将其输入appsettings.json

e、 g“DefaultConnection”:“服务器=IP;数据库=测试;用户=sa;密码=密码;”

其中IP=e.g 172.17.0.5,您可以通过docker inspect name命令找到它

另外

密码是您在创建docker(docker运行命令)时定义的SA密码。在微软的教程中,这是

您不必创建数据库,例如Test,因为EntityFramework应该这样做。(我不是100%确定,但我就是这么做的)

使用Virtualbox计算机中的“仅主机”网络设置使您的应用程序对主机可见(对于me windows)

此外,您可能需要添加nginx创建反向代理,例如http://piotrgankiewicz.com/2017/06/12/asp-net-core-deployment-using-docker-nginx-and-ubuntu-server/#more-3847

祝你好运

其他可能有用的链接:

Docker-容器未运行

https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-2.1

https://github.com/aspnet/KestrelHttpServer/issues/1263

 类似资料:
  • 我试图从Windows运行一个HBase Java客户端程序。我所拥有的只有1)一个没有任何编译器错误的Java程序2)hbase-site.xml(我没有其他HDFS或HBase配置文件。只有上面的一个。)当我运行程序时,我得到了以下错误--在最后一个块中给出的。我错过了什么吗?我在这里都给出了。

  • 我希望从VS2017调试一个Linux C++控制台应用程序,如以下教程所示: 使用Windows Subsystem For Linux在Visual Studio中编写和调试Linux C应用程序 从visual studio针对Linux的windows子系统 我已经在WSL Ubuntu 16.04安装中安装了gdbserver和openssh-server,正在运行,但是我无法从VS20

  • 我在我的Windows10电脑(Ubuntu18.04)上安装了Windows子系统Linux。我在Windows上安装了Docker toolbox,通过虚拟机运行,我可以通过以下设置正常运行Docker命令: 我可以很好地访问它并正确安装/运行docker容器。其中一个服务是运行在localhost:8084上的Kafka Connect容器,如果是从我的Windows创建的。如果我直接从Ub

  • 问题内容: Docker容器可以通过哪个IP地址连接到Windows版Docker(在Windows 10上)上的主机?您如何找到此IP地址? 例如:您有一个服务在Windows 10计算机上的端口1234上运行。容器中的程序必须访问此服务。程序应使用哪个IP地址连接到主机? 问题答案: 简短的回答 :在大多数情况下,您需要 10.0.75.1 。 在适用于Windows的Docker中,容器通过

  • docker容器可以在哪个IP地址上连接到它在docker for Windows(在Windows 10上)上的主机?如何找到这个IP地址?

  • 问题内容: 我可以从DOS提示符下成功连接到MySQL,但是当我尝试从cygwin连接时,它会挂起。 怎么了? 问题答案: 假设您具有MySQL的本机Windows版本,(命令提示符)Windows和Windows 之间没有终端仿真不兼容。提示没有出现。 要确认这一点,请键入命令并返回-它可能会起作用,但是命令的提示和回显(您键入的内容)会丢失。 系统属性或in中可能都存在一种解决方法,但是我从来