CakePHP立ち上げエラー[Your database configuration file is NOT present. Rename APP/Config/database.php.default to APP/Config/database.php]

CakePHP立ち上げエラー[Your database configuration file is NOT present. Rename APP/Config/database.php.default to APP/Config/database.php]

cakephp css

↑の画像の一番下の黄色行

Your database configuration file is NOT present.
Rename APP/Config/database.php.default to APP/Config/database.php

これは、\app\config\database.phpがないよエラーの為、

\app\config\database.php.defaultをコピーして\app\config\database.phpを作る。

 

再アクセスすると・・・

cakephp_error

エラーが別のメッセージに変わります。

CakePHP is NOT able to connect to the database.
Database connection "Mysql" is missing, or could not be created.

先ほどのファイル\app\config\database.phpを開いてDBの設定をしてあげます。

 public $default = array(
 'datasource' => 'Database/Mysql',
 'persistent' => false,
 'host' => 'localhost',
 'login' => 'root',
 'password' => 'password',
 'database' => 'test_local',
 'prefix' => '',
 //'encoding' => 'utf8',
 );

DBの準備をします。

$ mysql -uroot
mysql > create database test_local;
mysql > grant all on test_local.* to 'root'@'localhost' identified by 'password';

 

この状態でリロードすると黄色のメッセージが消えて緑色で以下が表示されました。

CakePHP is able to connect to the database.

Comments

No comments yet. Why don’t you start the discussion?

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です