My Sql Config

MySQL Config

Situation

I am using MAMP on Mac OS X Snow Leopard.
When I try to connect the Akelos applications through the Terminal (f.eg. for ./script/generate), I receive the error “Could not connect to database”.

Solution

Make sure you properly configure your /config/database.yml settings-file. Here are some tips to consider:

Setting Value Description
host 127.0.0.1 Use instead of localhost
port 8889 This is the default port for MAMP's MySQL-Server (default port for standalone MySQL would be 3306)
database_name database_dev
database_tests
or database
Depending on the current environment
user root For MAMP this is the default
password root For MAMP this is the default
Sample DB-Config for MAMP
development: 
    type:          mysql
    database_file: 
    host:          127.0.0.1
    port:          8889
    database_name: database_dev
    user:          root
    password:      root
    options: 
// Repeat for Testing (testing:)
// ...and Productive environment (productive:)

Current active Environment

How do I know what environment Akelos is currently using?
→ See the in the top part of the config-file /config/config.php:

// Current environment. Options are: development, testing and production
defined('AK_ENVIRONMENT') ? null : define('AK_ENVIRONMENT', 'development');
 
mysql.txt · Last modified: 2010/05/16 18:16 by 178.82.239.114
 

The Akelos Framework was created by Bermi Ferrer and other contributors.
Potions of the code and documentation have been ported from Ruby on Rails.

The Akelos Framework is released under the LGPL license.

"Akelos", "Akelos Framework", and the Akelos logo are trademarks of Bermi Labs All rights reserved.

Wiki driven by DokuWiki