Welcome Guest, Not a member yet? Register   Sign In
Database problem!
#1

[eluser]AdonisSMU[/eluser]
I am trying to use codeIgniter for one of my sites but for some reason I keep getting the error.

A Database Error Occurred
Unable to connect to your database server using the provided settings.

and Ive tested my config settings over and over again and they work but not with CI. Can someone please help me out?
I am using the latest version of CI.

Thanks again!
#2

[eluser]theprodigy[/eluser]
can you post your database.php file please (please remember to * your password, don't want to give that out Wink )
#3

[eluser]AdonisSMU[/eluser]
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the "Database Connection"
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database type. ie: mysql. Currently supported:
mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Active Record class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the "default" group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
*/

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

$db['default']['hostname'] = '209.61.159.147';
$db['default']['username'] = '360491_Power';
$db['default']['password'] = '*********';
$db['default']['database'] = '360491_HPN';
$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';


/* End of file database.php */
/* Location: ./system/application/config/database.php */
#4

[eluser]theprodigy[/eluser]
please remember to surround your code with the code tags. This makes it easier to be able to read the code given.

Is it safe to assume that since an IP address is given that this is a remote connection to the database? If so, can you verify that remote connections to the database server are allowed for your user account?
#5

[eluser]AdonisSMU[/eluser]
I shoudl've done that. I've used remote connections before. I don't understand why it would fail now.
#6

[eluser]AdonisSMU[/eluser]
[quote author="theprodigy" date="1260513049"]please remember to surround your code with the code tags. This makes it easier to be able to read the code given.

Is it safe to assume that since an IP address is given that this is a remote connection to the database? If so, can you verify that remote connections to the database server are allowed for your user account?[/quote]The reason I used the IP address is because it is what my host tells me to use it.

Quote:209.61.159.147
The alternate hostname should be used to manage your databases from a client external to our network.




Theme © iAndrew 2016 - Forum software by © MyBB