我连接到外部MSsql数据库从
PHP55 / osx导出,我有wierd问题.
原文链接:https://www.f2er.com/php/132995.html码:
new \PDO("dblib:host={$hostname};dbname={$dbname}",$user,$pass);
抛出:
sqlSTATE[01002] Adaptive Server connection Failed (severity 9)
但是CLI的连接工作正常
tsql -S主机名-U user -P pass -L dbname:
locale is "cs_CZ.UTF-8" locale charset is "UTF-8" using default charset "UTF-8" 1>
freetds.conf:
[hostname] host = ipaddress port = 1433 tds version = 8.0
tsql -C:
Version: freetds v0.91 freetds.conf directory: /usr/local/Cellar/freetds/0.91/etc MS db-lib source compatibility: no Sybase binary compatibility: no Thread safety: yes iconv library: yes TDS version: 7.1 iODBC: no unixodbc: no SSPI "trusted" logins: no Kerberos: no
有任何想法吗?我尝试过最好的东西,连接到hostname,ip,有和没有端口,到实例名称,另一个用户,TDS版本7.0,7.1,7.2,8.0,重新安装PHP和freetds