简体   繁体   English

从MAMP中的Php连接到MSSQL(在另一台计算机上)

[英]Connecting to MSSQL (on another machine) from Php in MAMP

I am trying to connect to a MSSQL database on another machine (Windows 8.1 & SQL Server 2014 - Express) within the same network in Php using the mssql_connect function. 我正在尝试使用mssql_connect函数连接到Php中同一网络内另一台计算机(Windows 8.1和SQL Server 2014-Express)上的MSSQL数据库。

I have installed MSSQL into MAMP (it is present as an area in phpinfo();) and I have tested the credentials using the SQLPro for MSSQL ( http://www.macsqlclient.com/ ) and it loads fine with SQLPro. 我已经将MSSQL安装到MAMP中(它在phpinfo()中显示为一个区域;),并且已经使用SQLPro for MSSQL( http://www.macsqlclient.com/ )测试了凭据,并且SQLPro可以很好地加载它。

Although when connecting via mssql_connect keeps giving the error: " mssql_connect(): Unable to connect to server:" 尽管通过mssql_connect连接时始终显示错误:“ mssql_connect():无法连接到服务器:”

I was wondering if I have missed anything? 我想知道我是否错过了什么? Thank you in advance. 先感谢您。

I was able to solve the issue: Even though FreeTDS was installed and running it was running the wrong version of TDS which stopped the connection. 我能够解决此问题:即使已安装并运行FreeTDS,但它运行的TDS版本错误,从而导致连接中断。

I used the config ( http://www.freetds.org/userguide/config.htm ) to configure to the right Version that was needed ( http://www.freetds.org/userguide/choosingtdsprotocol.htm ) 我使用配置( http://www.freetds.org/userguide/config.htm )来配置所需的正确版本( http://www.freetds.org/userguide/choosingtdsprotocol.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM