I have tried several drivers to connect my mint16 dev lappy to a windows 7 pc running sqlexpress 2012 and failed. FreeTDS and dblib being the most common I could find any reference to on google search....
The mssql pc has the firewall disabled. mssql has been configured to allow remote connections and ip2 has been configured with port 1433, ipaddress / tcpip and dynamic address disabled.....
In trouble shooting I have noticed I cannot telnet (telnet 192.168.1.10 1433) to the the pc. mssql has also been configured not to use windows authentication.....
The general error message was similar on both freetds and dblib which makes me think there is something I have missed.
Any assistance in pointing some things that may help me resolve this would be appreciated.. While I have benn through plenty of guides to date any additional known to be relavent would be appreciated.
Thanks, James
Quote:
There was a problem. Caught exception: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9)
|
Quote:
[TDS]
host = 192.168.1.10
port = 1433
tds version = 7.0
|
Code:
$msdbhost = "192.168.1.10\SQLEXPRESS";
$msdbname = "sqlCompanyTables";
$msdbuser = "mssql";
$msdbpass = "mypassword";
try {
// database connection
$msconn = new PDO("dblib:host=$msdbhost; dbname=$msdbname", $msdbuser, $msdbpass);
$msconn -> exec();
} catch(PDOException $e) {
echo 'There was a problem. Caught exception: ', $e->getMessage(), "\n";
}
Code:
$username="mssql"
$password="mypassword"
try { $con = new PDO('odbc:Driver=FreeTDS; Server=192.168.1.10\SQLEXPRESS; Database="sqlCompanyTables"; UID=$username;PWD=$password;');
}
$con = null;
} catch (PDOException $e) {
echo $e->getMessage();
}