0

I am trying to upload my codeigniter website to cpanel But, I am getting following error:

A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 346

I have uploaded all my files in directory: /home/mycpanelusername/public_html/

And,

database name = mycpanelusername_db_databasename
databae username = mycpanelusername_fajs
database password = mydbpassword

and I granted all privileges to my database

My database.php file is like this:

$db['default']['hostname'] = 'http://myurl.org';
$db['default']['username'] = 'mycpanelusername_fajs';
$db['default']['password'] = 'mydbpassword';
$db['default']['database'] = 'mycpanelusername_db_databasename';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

Thank you, If it's not clear please ask me

2 Answers 2

1

give $db['default']['hostname'] as ip address

$db['default']['hostname'] ="254.000.0.0";

or

$db['default']['hostname'] = 'localhost';

try like this

0
0

Try with localhost like

$db['default']['hostname'] = 'localhost';

May it works and also once check the login credntionals and Db name

1
  • Glad it helps for you,Now You can accpet it
    – GautamD31
    Commented Jun 11, 2013 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.