PHP link LAN MSSQL related issues [cause: not associated with a trusted SQL Server connection]

Source: Internet
Author: User
Tags mssql server
PHP link LAN mssql problem [cause: not associated with trusted SQL Server connection]
Code

    • PHP Code

    • $hostname = "HTSC"; $dbuser = "sa"; $DBPASSWD = "123456"; $id = Mssql_connect ($hostname, $dbuser, $dbpasswd) or die ("Unable to connect to the database server! ");


If it is a local MSSQL database, the link is passed. However, if the link LAN within the other machine is not. The error message is:
Warning:mssql_connect () [Function.mssql-connect]: Message: User ' (null) ' Login failed. Cause: It is not associated with a trusted SQL Server connection. (Severity 14)

I've tried a lot of ways:
1. SQL Server and Windows in mixed mode
2, in addition to SA, also tried to add other users (with all permissions) to link
3. Telnet IP 1433 test passed
4, the database is sql2000 SP4
5, tried to change a few computers
6, with sql2000 Ntwdblib.dll covered the php5 file

In addition, I write in VB code is normal access to another MSSQL server.
Look at the user of MSSQL, there is a user of ASPNET, do you want to add a similar PHP user to log in?

Please help me.

------Solution--------------------
$hostname change to an IP address try
------Solution--------------------
is the landlord using PHP to connect to SQL SERVER?

Need to be configured php.ini, to be removed from the front of the Extension=php_mssql.dll

The default does not load any extension libraries
------Solution--------------------

------Solution--------------------

------Solution--------------------
It seems that I have had this problem before.

Do you directly use SQL Server's graphical interface to access other computers through this computer?
------Solution--------------------
Is it a firewall problem?
------Solution--------------------
Help the top again.

  • 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.