Welcome Guest, Not a member yet? Register   Sign In
Database connection error when live on server (SOLVED)
#1

(This post was last modified: 07-05-2017, 05:32 PM by meSmashsta.)

I configure a VirtualBox VM for my server running UBUNTU (LAMP setup) and now after putting my project on the server it fails to connect to the database.

Error

PHP Code:
mysqli::real_connect(): (HY000/1045): Access denied for user 'usr'@'ip' (using passwordYES



my application/config/database config


PHP Code:
$active_group 'default';
$query_builder TRUE;

$db['default'] = array(
    
'dsn'    => '',
    
'hostname' => '***',
    
'username' => 'miko',
    
'password' => '***',
    
'database' => 'handler_monitoring',
    
'dbdriver' => 'mysqli',
    
'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
); 
Anyway a simple database connection from a pure PHP works, I don't understand why CI wont.
Pure PHP connection that works on the server
PHP Code:
("127.0.0.1""my_user""my_password""my_db" 
Turns out I had the wrong privileges.
Reply


Messages In This Thread
Database connection error when live on server (SOLVED) - by meSmashsta - 07-02-2017, 01:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB