我在 Virtualbox 下的 Windows 7 虚拟机中将 MSSQL 备份恢复到 SQL Server Express.我正在尝试使用导入数据库中具有连接凭据的用户从主机 (Mac OS) 连接到此 SQL Server 实例.虚拟机配置为使用 Host-Only 适配器.SQL Server express 在 WIN7VM/SQLEXPRESS 的 VM 内运行,端口为 1433.
I restored a MSSQL backup to SQL Server Express in a Windows 7 virtual machine under Virtualbox. I am attempting to connect to this SQL Server instance from the host (Mac OS) using a user inside the imported database that has credentials to connect. The virtual machine is configured to use a Host-Only adapter. SQL Server express is running inside the VM at WIN7VM/SQLEXPRESS, port 1433.
我能够从 Mac 主机通过端口 8080 连接到 VM 中的 Apache,没有任何问题.我还可以使用仅限主机的 IP 地址 (192.168.56.101) 从 Mac 主机通过 1433 端口 telnet 到 SQL 服务器.
I am able to connect to Apache in the VM on port 8080 from the Mac host without a problem. I can also telnet into the SQL server at port 1433 from the Mac host, using the host-only IP address (192.168.56.101).
我无法做的是从 MacOS 中的 Navicat 连接到 SQL 服务器,或者使用 PHP 远程连接.这是我尝试过的:
What I am unable to do is connect to SQL server from Navicat in MacOS, or remotely using PHP. Here is what I have tried:
我正在尝试连接此信息:
I am trying to connect with this info:
我在这里缺少什么才能远程连接而没有任何问题?提前致谢!
What am I missing here to be able to remotely connect without any issues? Thanks in advance!
原来不是 Virtualbox 问题,而是 SQL Server 身份验证问题.
It turned out to not be a Virtualbox issue, but a SQL Server authentication issue.
我尝试连接的用户可以访问数据库,但没有相应的 SQL Server 登录名.
The user I was trying to connect with had access to a database, but did not have a corresponding SQL Server Login.
MSDN - 管理登录名、用户和架构操作方法主题
这篇关于如何从 Mac 主机连接到 Win7 虚拟机中的 SQL Server?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!