drbi19093 2016-02-08 15:06
浏览 92

PDO OCI:信息例外成功

Using PHP 5.5.9 with PDO_OCI, Oracle 12.1. I'm getting an OCI_SUCCESS_WITH_INFO message that the password will expire soon. However, since it is thrown as an exception by PDO, the connection is not being established. How can I ignore the exception when it is just a warning or informational message?

Here is the error message:

Database Connection failed: SQLSTATE[HY000]: OCISessionBegin: OCI_SUCCESS_WITH_INFO: ORA-28002: the password will expire within 41 days

Followed by:

Fatal error: Call to a member function setAttribute() on a non-object in /htdocs/ciatools_dev/promise/Classes/PromiseVars.php on line 257

And the code that produces it:

try {
    $this->dbconn = new PDO("oci:dbname=$dbwc",'username', 'password');
} catch (PDOException $e) {
    echo 'Database Connection failed: ' . $e->getMessage();
}

$this->dbconn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  • 写回答

1条回答 默认 最新

  • duanfan9859 2016-02-08 15:16
    关注

    If this is a test system try changing the password of the user to see if resolves the error message. This thread has more details

    alter user <your user> identified by password;
    

    You could also alter the profile of that user so it does not expire which is acceptable on development but a security issue on production.

    --get the the profile 
    SELECT profile FROM dba_users WHERE username = <'Your user'>;
    --change the profile
    ALTER PROFILE <this user's profile> LIMIT PASSWORD_LIFE_TIME UNLIMITED;
    
    评论

报告相同问题?

悬赏问题

  • ¥20 怎么在stm32门禁成品上增加记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀
  • ¥15 flink cdc无法实时同步mysql数据
  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 解riccati方程组