Quantcast

Cake bake db setup: Fatal error: Class 'DATABASE_CONFIG' not found in db_config.php

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Cake bake db setup: Fatal error: Class 'DATABASE_CONFIG' not found in db_config.php

Joshua Muheim
Hi all

I have a fresh CakePHP 1.2.8 copy on my server and want to bake
something. But sadly I'm getting the following error when setting up
the db connection:

macbuech:tests josh$ cake bake


Welcome to CakePHP v1.2.8 Console
---------------------------------------------------------------
App : tests
Path: /Users/josh/Sites/tests
---------------------------------------------------------------
What is the full path for this app including the app directory name?
Example: /Users/josh/Sites/tests/myapp
[/Users/josh/Sites/tests/myapp] > /Users/josh/Sites/tests/app
Bake Project
Skel Directory: /Users/josh/Sites/cakephp/cake/console/libs/templates/
skel
Will be copied to: /Users/josh/Sites/tests/app
---------------------------------------------------------------
Look okay? (y/n/q)
[y] >
Do you want verbose output? (y/n)
[n] >
---------------------------------------------------------------
Created: app in /Users/josh/Sites/tests/app
---------------------------------------------------------------

Creating file /Users/josh/Sites/tests/app/views/pages/home.ctp
File exists, overwrite? /Users/josh/Sites/tests/app/views/pages/
home.ctp (y/n/q)
[n] >
Skip /Users/josh/Sites/tests/app/views/pages/home.ctp

The Welcome page was NOT created
Error: Unable to generate random hash for 'Security.salt', you should
change it in /Users/josh/Sites/tests/config/core.php
Error: Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in /
Users/josh/Sites/tests/app/webroot/index.php
Error: Could not set permissions on /Users/josh/Sites/tests/app//tmp
chmod -R 0777 /Users/josh/Sites/tests/app//tmp
Your database configuration was not found. Take a moment to create
one.
---------------------------------------------------------------
Database Configuration:
---------------------------------------------------------------
Name:
[default] >
Driver: (db2/firebird/mssql/mysql/mysqli/odbc/oracle/postgres/sqlite/
sybase)
[mysql] >
Persistent Connection? (y/n)
[n] >
Database Host:
[localhost] >
Port?
[n] >
User:
[root] >
Password:
> **********
Database Name:
[cake] > tests
Table Prefix?
[n] >
Table encoding?
[n] >

---------------------------------------------------------------
The following database configuration will be created:
---------------------------------------------------------------
Name:         default
Driver:       mysql
Persistent:   false
Host:         localhost
User:         root
Pass:         **********
Database:     tests
---------------------------------------------------------------
Look okay? (y/n)
[y] >
Do you wish to add another database configuration?
[n] >

Fatal error: Class 'DATABASE_CONFIG' not found in /Users/josh/Sites/
cakephp/cake/console/libs/tasks/db_config.php on line 264

The funny thing is, that my database.php actually is set up and works!

        var $default = array(
                'driver' => 'mysql',
                'persistent' => false,
                'host' => 'localhost',
                'login' => '*******',
                'password' => '*********',
                'database' => 'tests',
                'encoding' => 'utf8'
        );
        var $test = array(
                'driver' => 'mysql',
                'persistent' => false,
                'host' => 'localhost',
                'login' => '*******',
                'password' => '******',
                'database' => 'tests_test',
                'encoding' => 'utf8'
        );

So what's the problem?? Neither does "cake bake" recognize my working
database setup in database.php nor does its own setup generator
work...

Any help is highly appreciated.
Josh

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Loading...