• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database connection error when live on server (SOLVED)

#1
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.