I wanna study cakePHP and everything is configured correctly, except the problem in yellow color which follows.
'CakePHP is NOT able to connect to the database. Database connection "Mysql" is missing, or could not be created.'
I looked through google and tried everything to fix this problem but none worked. The Extension php_pdo_mysql is set, I also could connect to my database using phpMyAdmin and I tried testing my connection using the following code which connection is ok and extension pdo_mysql is loaded.
<?php
$link = mysql_connect('localhost','root','');
if (!$link) {
die('Could not connect to MySQL: ' . mysql_error());
}
echo 'Connection OK'; mysql_close($link);
var_dump( extension_loaded('pdo_mysql') );
?>
The database.php file under app/Config follows: (note: I tried localhost on hostname and didn't work too)
class DATABASE_CONFIG {
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => '127.0.0.1',
'login' => 'root',
'password' => '',
'database' => 'database_name',
'prefix' => '',
//'encoding' => 'utf8',
);
public $test = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => '127.0.0.1',
'login' => 'root',
'password' => '',
'database' => 'test_database_name',
'prefix' => '',
//'encoding' => 'utf8',
);
}
The server that I'm using is wamp and it's working fine, I mean everyting is in green color on it status.
Please, could someone help me?!