tp5 AWS redshift驱动(修正非public错误)
浏览:1514
最后更新:2017-11-09 12:27
分类:驱动
这个是其驱动,原则上tp自带的PG驱动也可以,但使用过程报错,经简单修改发布这个版本的驱动.原则上也兼容postgre数据库
安装方式:
composer require gclinux/think-redshift
使用方式跟tp使用其他数据库一样,例如:<?php
/*含有自动加载时间和 编辑者的*/
namespace app\common\model;
use think\Model;
class Redshift extends Model {
protected $connection = 'redshift';
}
config.php 配置文增加 redishift'redshift'=>[
'type' => 'redshift',
// 数据库连接DSN配置
'dsn' => '',
// 服务器地址
'hostname' => 'XXX.XXXX.redshift.amazonaws.com',
// 数据库名
'databa
// 数据库用户名
'username' => 'joffe',
// 数据库密码
'password' => 'xxxxxxx',
// 数据库连接端口
'hostport' => '5439',
]