mysql配置
'DB_USER' => array('DB_TYPE' => 'mysql','DB_HOST' => '127.0.0.1','DB_NAME' => 'blog','DB_USER' => 'root','DB_PWD' => '','DB_PORT' => '3306','DB_PREFIX' => '','DB_CHARSET'=> 'utf8', // 字符集),
Oracle配置(模式)
'DB_DATA' => array('DB_TYPE' => 'Oracle', // 数据库类型'DB_HOST' => '10.10.10.110', // 服务器地址'DB_NAME' => 'blog_data', // 数据库名'DB_USER' => 'root', // 用户名'DB_PWD' => '', // 密码'DB_PORT' => 1521, // 端口'DB_PREFIX' => '', // 数据库表前缀'DB_CHARSET'=> 'utf8', // 字符集),
Oracle的Model模型
namespace Common\Model;use Think\Model;class LocalModel extends Model {protected $connection = 'DB_DATA';protected $tableName = 'ADW.GET_BLOG_DATA'; }
database配置文件
<?php
return array(/* 数据库配置 */'DB_DSN' => 'mysql://cdnbase:cdnbase@192.168.144.223:3312/cdnbase#utf8',//'DB_TYPE' => 'pdo', // 数据库类型//'DB_USER' => 'cdnbase', // 用户名//'DB_PWD' => 'cdnbase', // 密码//'DB_DSN' => 'mysql:host=192.168.144.223:3312;dbname=cdnbase;charset=utf8',//'DB_TYPE' => 'mysqli', // 数据库类型//'DB_HOST' => '192.168.144.223', // 服务器地址//'DB_NAME' => 'cdnbase', // 数据库名//'DB_USER' => 'cdnbase', // 用户名//'DB_PWD' => 'cdnbase', // 密码//'DB_PORT' => '3312', // 端口'DB_PREFIX' => 'cdn_', // 数据库表前缀
);