[ 'class' => 'yii\db\Connection', # 'dsn' => 'mysql:host=192.168.1.214;dbname=valuesys', 'dsn' => 'pgsql:host=192.168.1.214;port=5432;dbname=valuesys', 'username' => 'postgres', 'password' => 'Hebei_123.', 'charset' => 'utf8', 'tablePrefix' => 'wz_', // Schema cache options (for production environment) //'enableSchemaCache' => true, //'schemaCacheDuration' => 60, //'schemaCache' => 'cache', /* // 配置从服务器账户密码 'slaveConfig' => [ 'username' => 'root', 'password' => 'root', 'attributes' => [ // use a smaller connection timeout PDO::ATTR_TIMEOUT => 10, ], 'charset' => 'utf8', ], //配置从服务器组 'slaves' => [ ['dsn' => 'mysql:host=192.168.0.2;dbname=hyii2'], ], */ ], 'db2' => [ 'class' => 'yii\db\Connection', # 'dsn' => 'mysql:host=192.168.1.214;dbname=valuesys', 'dsn' => 'pgsql:host=192.168.1.214;port=5432;dbname=valuesys', 'username' => 'valuesys', 'password' => 'Hebei12#$', 'charset' => 'utf8mb4', 'tablePrefix' => 'wz_', // Schema cache options (for production environment) //'enableSchemaCache' => true, //'schemaCacheDuration' => 60, //'schemaCache' => 'cache', /* // 配置从服务器账户密码 'slaveConfig' => [ 'username' => 'root', 'password' => 'root', 'attributes' => [ // use a smaller connection timeout PDO::ATTR_TIMEOUT => 10, ], 'charset' => 'utf8', ], //配置从服务器组 'slaves' => [ ['dsn' => 'mysql:host=192.168.0.2;dbname=hyii2'], ], */ ], ];