CodeIgniter Forums
Database connection issue - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Database connection issue (/thread-1746.html)

Database connection issue - El Forum - 06-24-2007

Hi everybody!

I'm having a problem with my CI app. On my computer, running PHP5 and MySQL, everything's OK, my app connects to the database, retreives datas...

The problem is, when I upload my application (with new database.php and config.php files with the actual informations of my webhost), CI cannot connect to my database, and shows the following error message:

Unable to connect to your database server using the provided settings.

What's the problem? My database infos are correct (I'm sure of this), the path to my application is correctly set in the config.php file...

Thanks Wink

PS: My webhost is running PHP5 and MySQL too

Database connection issue - El Forum - 06-25-2007

[eluser]Glen Swinfield[/eluser]
Speak to your host. If your connection details are correct it should connect.

Database connection issue - El Forum - 06-25-2007

You're probably right, but my website (built without CI) works well, with the same connection details. That's the point that makes me think there is a problem with CI.

Is there any special function used to connect the database in CodeIgniter that might not be allowed by my host?

See you Smile

Database connection issue - El Forum - 07-03-2007

You could try to avoid persistent connections using this line:

$db['default']['pconnect'] = FALSE;

in the application/config/database.php

(this fix a problem in my host one time).

Database connection issue - El Forum - 07-04-2007

OK thanks, I'll try this !

Database connection issue - El Forum - 11-04-2007

im also having the same problem.
i have checked the connection with mysql_connect and it works fine.

also my $config['base_url'] is not gettin updated and the site is redirecting to my localhost and from the localhost it goes back to the actual site because on the localhost the baseurl is set to the online site.

so maybe the database connection settings are not getting uploaded correctly or there is some kind of cache-ing problem.

I downloaded the uploaded files and it holds the correct information that expect to be in it.

Database connection issue - El Forum - 11-04-2007

also note that i deleted everything in my home controller, which means it shudnt try to connect to the database cox im not autoloading the library but what i get is still the error instead of an empty page