Cannot connect to oracle database
Cannot connect to oracle database
Hi,
I'm getting following error when trying to connect to an oracle database via datatables-editor:
"error": "An error occurred while connecting to the database 'cmo'. The error reported by the server was: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
tnsping my-db-name works ok
sqlplus from CLI works ok
Simple oracle connect from simple PHP works OK
Snippet from config.php:
$sql_details = array(
"type" => "Oracle", // Database type: "Mysql", "Postgres", "Sqlserver", "Sqlite" or "Oracle"
"user" => "myusername", // Database user name
"pass" => "mypassword", // Database password
"host" => "my-ip", // Database host
"port" => "1521", // Database connection port (can be left empty for default)
"db" => "my-db-name" // Database name
);
Any help appreciated
/Claus
Answers
Our config for the testing is
The only difference being the
pdoAttr
anddsn
options - could you try setting those the same and see if that helps, please?Colin
I think I sorted it out.
In
datatables\php\Database\Driver\Oracle\Query.php
//$conn = @oci_connect($user, $pass, $host.$port.'/'.$db, 'utf8');
$conn = @oci_connect($user,$pass,$db);
Something odd with the connector.
Modified it a bit and now I'm connected.