CodeIgniter Forums

Full Version: Database connection issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]metalking[/eluser]
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

El Forum

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

El Forum

[eluser]metalking[/eluser]
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

El Forum

[eluser]Unknown[/eluser]
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).

El Forum

[eluser]metalking[/eluser]
OK thanks, I'll try this !

El Forum

[eluser]andho[/eluser]
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.

El Forum

[eluser]andho[/eluser]
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