• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Codeigniter installation on production server

[eluser]Manish Sunthwal[/eluser]

I am using codeigniter framework, and was successful making my own application using this framework on my local machine (localhost). However, after completion of application, now when I upload the same on production server, I am getting below mentioned 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 gone through almost all the topics covered in this forum regarding this problem faced by other CI users. However, unable to succeed.

My config.php code is configured as under:

$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'abcd.com'; (here i have also tried, localhost )
$db['default']['username'] = 'visi5605_dm';
$db['default']['password'] = 'xxxxxx';
$db['default']['database'] = 'visi5605_ed';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = FALSE;
$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;

Would really appreciate if someone could assist me out with the same.

Thanks & Regards,
Manish Sunthwal

[eluser]TWP Marketing[/eluser]
The usual culprits are the hostname, username and password.

1) Can you login to your production database using the username and password? using phpmyadmin or such tools?

2) If you are attempting to connect to the production server from the same machine that contains your development environment, be sure that you are not using the same names in the HOSTS file (windows or linux). I ran into this because I use virtual hosting during development using the same host name as my intended production environment.

[eluser]Manish Sunthwal[/eluser]
Yeah - I am able to connect to my production database using the same username and password. I am unable to find out where is the mess, I have tried all the possibilities while reading CI's earlier posts.

Thanks & Regards,
Manish Sunthwal

[eluser]TWP Marketing[/eluser]
Sorry for the delay, I still don't see anything obvious which might be the problem.
Have you autoloaded the database library in your autoload.php config file? /config/autoload.php
$autoload['libraries'] = array('database');

[eluser]Manish Sunthwal[/eluser]
Yeah - I did autoloaded my database while utilizing the power of config/autoload.php....

Very true - even I don't see any obvious reason as on why I am fetching this error... Sad

and yes it is obvious that I don't want to give up so soon - I am sure that together we can crack it... Smile

Thanks & Regards,
Manish Sunthwal

[eluser]TWP Marketing[/eluser]
Just in case it is a really simple error...

Do the database names match?
Are you using the same database name: "visi5605_ed", on both local and production servers?

[eluser]Manish Sunthwal[/eluser]
Nope... on my local server - db_name is different to the one on production server.

What version of mysql does the production server have? I know the mysql driver won't work on really old version 4's That's why I ask.

[eluser]Manish Sunthwal[/eluser]
Server version: 5.5.23-55

[quote author="Manish Sunthwal" date="1347114042"]Server version: 5.5.23-55[/quote]

Client Version?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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