Welcome Guest, Not a member yet? Register   Sign In
Error on the data base Connection
#1

[eluser]anouar[/eluser]
hello very body

i'm a beginner on the C.I.,I ve tried to apply and to concept the blog, which was implemented on the video tutorials, but on the connection step with the database ,
i've received an error message (as figured bellow)

Quote:An Error Was Encountered

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


So, i tried to reconfigure the database.php as figured below but the pb persist.
Code:
$active_group = "default";

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "";
$db['default']['password'] = "";
$db['default']['database'] = "blog";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['active_r'] =TRUE ;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = TRUE;

if you have an idea about this error , could you pass me the solution .
Best regards
El Amri Anouar Nabil.


Ps : i'm using MySQL 4.1.9 version
#2

[eluser]nirbhab[/eluser]
Please provide settings to database.php file in config directory.

Code:
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "myusername";//[color=red]USERNAME[/color]
$db['default']['password'] = "mypassword";//[color=red]PASSWORD[/color]
$db['default']['database'] = "blog";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['active_r'] =TRUE ;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = TRUE;

$this->load->database($config);
#3

[eluser]Open Book software[/eluser]
this is my config

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

I connect successfully by localhost but

and I need to connect to this IP address

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

for example but I can't connect this is the error message
------------------------------------------------------------
An Error Was Encountered

No se ha podido conectar al servidor de base de datos usando la configuraciĆ³n.
------------------------------------------------------------------------------

I need HELP...
#4

[eluser]nirbhab[/eluser]
see this is a permission error check for mysql configurations rather than php script or CI, check for permission to user, change it to '%' rather than 'localhost', but i would recommend you not to do so due to security issue.




Theme © iAndrew 2016 - Forum software by © MyBB