The same error I was getting when I upload my codeigniter project from localhost to Live server.
What solution I find is to make some changes into the application => config => database.php
Following is the database setting for the
localhost
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'creator',
'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
);
Following database setting for
live server (Just demo, setting differ as per hosting provider)
1) First you have to create database.
2) find MySql Databases(or anything related database) on dashboard,
3) create new database and put database name, username, password.
4) export database from localhost
5) open phpmyadmin on live server and import it.
6) change the setting of application=>config=>database.php by using FTP client or dashboard.
$db['default'] = array(
'dsn' => '',
'hostname' => 'mysql.hostingprovider.com',
'username' => 'abc.username',
'password' => 'abc.password',
'database' => 'abc.databasename',
'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
);