Welcome Guest, Not a member yet? Register   Sign In
Migration from CI3 to CI4 - SQLServer
#1

I'm having difficulty configuring CI4 to connect to SQL Server. Undecided

I have the following configuration on CI3 that works perfectly:

PHP Code:
$db['ADMINBD04'] = array(
    
'dsn'    => '',
    
'hostname' => 'ADMINBD\NAME',
    
'username' => 'userci',
    
'password' => '#password123',
    
'database' => 'BASE',
    
'dbdriver' => 'sqlsrv',
    
'dbprefix' => '',
    
'pconnect' => FALSE,
    
'db_debug' => (ENVIRONMENT !== 'production'),
    
'cache_on' => FALSE,
    
'cachedir' => '',
    
'char_set' => 'utf8',
    
'dbcollat' => 'utf8_general_ci',
    
'swap_pre' => '',
    
'encrypt' => FALSE,
    
'compress' => FALSE,
    
'stricton' => FALSE,
    
'failover' => array(),
    
'save_queries' => TRUE
); 

I tried to replicate at CI without success.

.evn

Code:
database.default.hostname = ADMINBD\NAME
database.default.database = BASE
database.default.username = userci
database.default.password = #password123
database.default.DBDriver = SQLSRV
database.default.port = 1433

Or in the Configuration file.

PHP Code:
    public $default = [
        
'DSN'      => '',
        
'hostname' => 'ADMINBD\NAME',
        
'username' => 'userci',
        
'password' => '#password123',
        
'database' => 'BASE',
        
'DBDriver' => 'SQLSRV',
        
'DBPrefix' => '',
        
'pConnect' => false,
        
'DBDebug'  => (ENVIRONMENT !== 'production'),
        
'charset'  => 'utf8',
        
'DBCollat' => 'utf8_general_ci',
        
'swapPre'  => '',
        
'encrypt'  => false,
        
'compress' => false,
        
'strictOn' => false,
        
'failover' => [],
        
'port'     => 1433,
    ]; 

I don't know what I'm doing wrong, I thank you for your help. Huh
Reply


Messages In This Thread
Migration from CI3 to CI4 - SQLServer - by Marcos Queiroz - 05-14-2021, 06:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB