Welcome Guest, Not a member yet? Register   Sign In
The database isn't working
#1

[eluser]dim[/eluser]
Hi
I created a db, then I made a model and when I tried to reload my site (localhost). It gave me this message. I haven't touched the file DB_driver.php


A Database Error Occurred

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

Filename: I:\Program Files\xampp\htdocs\ci\system\database\DB_driver.php

Line Number: 124

What can I do to fix it?
#2

[eluser]alexaaaaaaaaaa[/eluser]
you need to provide the auth settings to the file database.php located in the folder config/

u'll find
Code:
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'database_user';
$db['default']['password'] = 'database_pass';
$db['default']['database'] = 'database_name';
#3

[eluser]dim[/eluser]
I 've already done it but it isn't working
#4

[eluser]InsiteFX[/eluser]
Did you load the database?
#5

[eluser]dim[/eluser]
yes with the command $q = $this -> db -> get('test'); in a file in models folder.
#6

[eluser]InsiteFX[/eluser]
you need to do one of these!
Code:
// ./application/config/autoload.php
$autoload['libraries'] = array(
'database',
'session'
);

// or in your Controller.
$this->load->database();
#7

[eluser]dim[/eluser]
Neither of the ways work.
#8

[eluser]InsiteFX[/eluser]
Then your database settings are wrong!
#9

[eluser]dim[/eluser]
how can i fix them?
#10

[eluser]InsiteFX[/eluser]
./application/config/database.php
Code:
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'user_login';
$db['default']['password'] = 'user_password';
$db['default']['database'] = 'your_database_name';

If these are correct then you must not have started the mySQL database server




Theme © iAndrew 2016 - Forum software by © MyBB