Your configuration is wrong, but you'd probably already figured that. ;)
When it comes to configuration, Fuel works with environments, which are defined as folders within the config directory. By default, Fuel runs in the "development" environment.
All config that is environment (server, webserver, etc) specific should go into an environment folder, and that includes database configuration.
If you have a configuration file in both your environment folder and in the global config folder, like is the case for db.php, both will be merged, where the environment one wins. The rationale behind this is that you can use the global file for global config, and the environment one for environment specific config.
An example for this is the main config file: you would have profiling switched of in that file, but you would have a config.php in the development folder that enables profiling. So it's on when you develop, and off in other environments such as staging and production.
The most common beginners mistake is that configuration is added to the global config (in this case APPPATH/config/db.php instead of in the environment config (in this case APPPATH/config/development./db.php). Because of the merge operation mentioned above, the empty environment config will overwrite the global one you've made.
If this is not the case, please post your APPPATH/config/development/db.php (wipe passwords and hostnames), so we can have a look.
I am completely new in Fuelphp.. just fallowed the instructions for the main web site...
Anyway, i first put this code below in global db.php, that could not work...after put in the development/ db.php and after in every envirenment db php.
This is code:
<?php
/**
* The development database settings. These get merged with the global settings.
There are two different ways of defining the database, and that depends on the type. There is one for legacy drivers, and there is one for PDO.
Since your config doesn't specify the type, Fuel will default to PDO, but you have used the legacy syntax.
return array( 'active' => 'pdoconfig',
// use this for legacy drivers such as mysql or mysqli 'legacyconfig' => array( 'type' => 'mysqli', 'connection' => array( 'hostname' => 'localhost', 'database' => 'my database',
So it probably fails because it defaults to PDO but the "dsn" entry is missing. It is required because it specifies the database engine to connect to (mysql in this example). Alternatively use your existing config, but add: "type" => "mysqli".
I also found that incorrect after i was reading the documentation ...but now i got like this below , even i know my database, username, password are correct.
Oh, excuse me for a ton of questions. I am going to continue reading about, to resolve bymyself, but all suggestions are welcome .
Thanks again.
1045! Fuel\Core\Database_Exception [ 1045 ]: Access denied for user 'mydatabaseusername'@'localhost' (using password: YES)
C:/xampp/htdocs/fuelphp/fuel/core/classes/database/mysql/connection.php @ line 108
103 catch (\ErrorException $e) 104 { 105 // No connection exists 106 $this->_connection = null; 107 108 throw new \Database_Exception(str_replace($password, str_repeat('*', 10), mysql_error()), mysql_errno()); 109 } 110 111 // \xFF is a better delimiter, but the PHP driver uses underscore 112 $this->_connection_id = sha1($hostname.'_'.$username.'_'.$password);
The username and password you have specified don't give you access to that database, so you need to check your MySQL config. Make sure username and password are ok, and that this user has rights to access this database from localhost.
And when you make changes, don't forget to flush privileges to make MySQL reload the permissions.