略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: PDO_OCI DSN

2025-02-27

PDO_OCI DSN

(PECL PDO_OCI >= 0.1.0)

PDO_OCI DSNConnecting to Oracle databases

说明

The PDO_OCI Data Source Name (DSN) is composed of the following elements:

DSN prefix

The DSN prefix is oci:.

dbname (Oracle Instant Client)

The URI for the Oracle Instant Client connection takes the form of dbname=//hostname:port-number/database. If you are connecting to a database defined in tnsnames.ora, use only the name of the database: dbname=database.

charset

The client-side character set for the current environment handle.

示例

示例 #1 PDO_OCI DSN examples

The following examples show a PDO_OCI DSN for connecting to Oracle databases:

// Connect to a database defined in tnsnames.ora
oci:dbname=mydb

// Connect using the Oracle Instant Client
oci:dbname=//localhost:1521/mydb
添加备注

用户贡献的备注

此页面尚无用户贡献的备注。

官方地址:https://www.php.net/manual/en/ref.pdo-oci.connection.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3