Conquer CakePHP Series 1 Connection to MySQL database

Source: Internet
Author: User
Please refer to the previous article to learn about CakePHP, the previous article first read this http://www.bitsCN.com/article/16244.htm
Next, we will describe this framework step by step.
First, download the framework:
Official Homepage: http://cakephp.org/
: Http://cakeforge.org/frs? Group_id = 23 & release_id = 428.
Official documents: http://book.cakephp.org/view/305/The-Manual
Third-party Introduction: http://www.1x3x.net/cakephp/
Select stable version 1.1.4247692
Download the cake_1.1.4107692.zip file and decompress it, as shown in. create a project.

Run: http: // localhost/cakephp_demo/

Modify the name of the database. php. default file to database. php, and modify the configuration information, for example:

  1. Class DATABASE_CONFIG
  2. {
  3. Var $ default = array ('driver '=> 'mysql ',
  4. 'Connect '=> 'MySQL _ connect ',
  5. 'Host' => 'localhost ',
  6. 'Login' => 'root ',
  7. 'Password' => 'root ',
  8. 'Database' => 'test ',
  9. 'Prefix' => '');
  10. Var $ test = array ('driver '=> 'mysql ',
  11. 'Connect '=> 'MySQL _ connect ',
  12. 'Host' => 'localhost ',
  13. 'Login' => 'root ',
  14. 'Password' => 'root ',
  15. 'Database' => 'test ',
  16. 'Prefix' => '');
  17. }

Run the appeal URL again:

The database connection is successful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.