How to connect cake php to database?


So no more talk, I will discuss how to connect cake php with database (Mysql)
First you have to go https://localhost/security/index.php and create the user name and password.
Second go https://localhost/phpmyadmin/index.php login and create login create a database.

Suppose, our data base name is project
Now you have to edit some filed. Then go C drive for C:\xampp\htdocs\cake_test\app\config
Then you will see a file with name database.php
Open this with windows Notepad or any other note pad like Notepad ++
After opening the file you will have a look like the beneath picture 


Now you have to edit some fields to connect cake to database
1.       User
2.       Password
3.       Database_name
In this example our user name is: root
                                 Password: 123
                    And database name is: project

After filling with these above parameters the page will be look like the beneath picture



Disclaimer: There are many ways to connect database with cake php. This is simple one.

Comments

Popular posts from this blog

How not to be wronged

How to Download Video from Youtube - The Easiest way