Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connection problem using PDO_OCI

569751Mar 29 2007 — edited May 2 2007
Hello,

I am trying to use Oracle for the first time because I am developing a PHP application and the customer decided half way into the project that later he wants to use Oracle. He will be using Oracle 9.2.

I decided to first give it a try in my Windows XP box.
Oracle is up and running, I also created a database and a user and I am able to connect using SQL+.

My PDO connection test script looks like this:
<?php
try {
$dbh = new PDO("oci:dbname=mydatabase;charset=AL16UTF16", "myusername", "mypassword");
} catch (PDOException $e) {
echo "Failed to obtain database handle " . $e->getMessage();
}
?>

So I already found out that the "oci:" must be in lower case and I also was able to find out the charset which my database installation uses.

Now I keep getting ORA-01017. Interesting is, that I do not get "ORA-01017: invalid username/password; login denied" but really only "ORA-01017:", so the colon at the end is there, but no clear text message.

After finding this article http://www.dbmotive.com/oracle_error_codes.php?errcode=01017 I tried turning on auditing. I do now have a table dba_audit_session, it only has one column, though, which is called OS_USERNAME. Each time my PDO connection fails one line is added to this table, which looks like this:
MYCOMPUTERNAME\mycomputerusername

What does this mean? Does PHP/PDO, called via Apache, not hand over the given username/password but try to connect via some single sign on thing?

Just for the fun of it I already tried to create users with names like "mycomputerusername" and "MYCOMPUTERNAME\mycomputerusername" but still I couldn't log in.

Any hints? Any more possibilities for finding more logging information?

Cheers,

Axel
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 30 2007
Added on Mar 29 2007
4 comments
6,517 views