Mssql_connect () connection issues under CentOS, "Unable to connect to server" issue

Source: Internet
Author: User
Help: Mssql_connect () connection problem under CentOS, "Unable to connect to server" issue appears.
The "Unable to connect server" error message always appears when using Mssql_connect () under the CentOS system.

Background: The Web server for the CentOS system needs to connect to the MSSQL database server. MSSQL database uses MSSSQL2000, (MSSQL2008 also tried, the problem is the same).

CentOS System use Yum InstallMode has been installed FreeTDSAnd Php-mssqlmodule, using phpinfo ()View Php-mssql has been installed successfully. For use under CentOS TSQLTest connect MSSQL account password, all correct. However, when you connect using the Mssql_connect () function in a php file, it always appears " Unable to connect server"The fault prompt (through error_log query).

Program code:
$link = Mssql_connect (' 192.168.100.10:1433 ', ' sa ', ' * * * * '); // There are always errors, add no port number: 1433, the fault is stillif (! $link)
{
Die (' Unable to connect! error: '. Mssql_get_last_message ());
}
?>


Seek the expert to solve!
------Solution--------------------
Just one can't connect, no more clear error message?
Output mssql_get_last_message () see what it is.
It looks like it's installed properly, right? SQL Server I had a situation where SA was not recorded successfully and the final setting was resolved
You test it again and try to get a more detailed error message.
------Solution--------------------
And you change the IP to localhost or 127.0.0.1 and try again.
------Solution--------------------
You don't have the authority, of course not even up.
------Solution--------------------
Is it the original code? Why do I look at mysql_connect () all wrong????
------Solution--------------------
The database side is another Windows MSSQLSERVER server!!!
Are you cross-domain access, halo
The default installation of MSSQL, which is not allowed for remote linking, requires that the remote link be opened to the server in Configuration Manager before it can be properly linked.
In addition, the remote link, also affected by the firewall, any one end (that is, the client and server side) of the firewall, can prohibit its normal link.
It is recommended to configure the network environment first, and then check the MSSQL configuration, the last is to check your PHP program.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.