Tag Archives: freetds

PHP under linux uses pdo-dblib to connect to mssql to report an error solution. Error message: SQLSTATE[01002] Adaptive Server connection failed (severity 9)

I found a lot of answers on the Internet, but they are not the root cause of the problem.
Finally, it can be seen on the official website that the connection of PDO_dblib to MSSQL database is through FreeTDS.
PDO_DBLIB is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to Microsoft SQL Server and Sybase databases through the FreeTDS libary.
Therefore, the problem was found. Freetds is a re-implementation of TDS protocol (Baidu’s). Different database versions use different VERSIONS of TDS protocol, so it is ok to modify the corresponding TDS version.
I am an Ubuntu system and the installation directory of Freetds is /usr/local/freetds
Modify the file to/usr/local/freetds/etc/freetds. Conf file.
Connect SQL Server2000, I change to TDS version=4.2 is ok, although Baidu is 8.0, I do not know this, but I know the key of the problem is ok, and so on in the future to understand the update.