CakePHP Database Configuration

May 22, 2007 at 5:41 am | Posted in tutorial | 7 Comments

cakephp logoCakePHP Database Configuration

 1. A copy of Cake’s database configuration file is found in /app/config/database.php.default. Make a copy of this file in the same directory, but name it database.php.

  2. On http://localhost/phpmyadmin/ create your own database.

***We will be using the following data:

user: mine
database name: mydatabase
password : mypass

3. Open database.php. (either notepad or dreamweaver)

4. Edit



var $default = array(‘driver’ => ‘mysql’,

‘connect’ => ‘mysql_connect’,

‘host’ => ‘localhost’,

‘login’ => ‘mine’, //the user of your database

‘password’ => ‘mypass’, //the password of your database

‘database’ => ‘mydatabase’, //the name of your database

‘prefix’ => ”);

This is the first time and the last time that you will configure your database. You will be using a single database, you will just add tables.

5. Save database.php.

6. Open http://localhost/cake. You must see these two messages:


Your database configuration file is present.

Cake is able to connect to the database.





RSS feed for comments on this post. TrackBack URI

  1. hi. i installed php cake stable version .but i cannot able to set up the php cake.

    but i set database to my system.

    but home page is not displayed.pls help to give the detailed information.

  2. hello…
    Are you using XAMMP? What is the error that shows in your browser when you access http://localhost/cake/?

    Maybe we can chat online to deal with your problem.



  3. hi. thanks for you. i set the pages in cakephp modules.after i get the designs.

    but my browser does not show the index.php in cakephp images.

  4. am using cake… installation am getting error… its showing your database configuration is present and you can able to connect
    to the database….but am not getting the output…its showing only this message….am written
    all mvc codes

  5. cn u help me on this….

  6. hello…
    i’m willing to help you. 🙂

    What exactly the error is? I mean the message error,what it is?


  7. Your database configuration file is present.

    Cake is able to connect to the database.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at
Entries and comments feeds.

%d bloggers like this: