Welcome Guest, Not a member yet? Register   Sign In
Second base in ENV
#1

(This post was last modified: 11-23-2022, 02:33 PM by motoroller.)

i have settins in ERV
for the first database is ok default group

but when i added second one
and try to connect
i got next "second is not a valid database connection group."

if i add to config empty second

public $first= [
'DSN' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'),
'charset' => 'utf8',
'DBCollat' => 'utf8mb4_unicode_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
];

public $second= [
'DSN' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'),
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
];

i got Main connection [MySQLi]: Access denied for user ''@localhost (using password: NO)
i think CI can get info about second database from ENV


database.default.hostname = localhost
database.default.database = first
database.default.username = root
database.default.password = root
database.default.DBDriver = MySQLi
database.default.port = 3306

database.animalface.hostname = localhost
database.animlaface.database = second
database.animlaface.username = root
database.animlaface.password = root
database.animlaface.DBDriver = MySQLi
database.animlaface.port = 3306
Reply


Messages In This Thread
Second base in ENV - by motoroller - 11-23-2022, 02:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB