You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

Setup Database

COmanage Registry is tested against PostgreSQL and MySQL. It may work against other databases supported by CakePHP, but no other databases are regularly tested.

Use InnoDB Storage Engine With MySQL

If you are using MySQL, use the InnoDB storage engine, not MyISAM.

To set this as the default storage engine on a Unix-like system, add the following to /etc/my.cnf and restart mysql before setting up the database tables:

# Set default engine to InnoDB
default-storage-engine=InnoDB

(You can also set the storage engine on a per-session or per-table basis, see the MySQL documentation for details.)

Create a new database for COmanage Registry. You can name the new database whatever you like since you will configure the Registry below with the name of the database.

Configure COmanage Registry

Copy the file registry-current/app/Config/database.php.default to registry-current/local/Config/database.php. (For versions prior to v1.0.0, copy the file to registry-current/app/Config/database.php instead.)

Edit this file with your database connection information, including the password needed to connect to the database.

Prefix Must Be cm_

Currently, the prefix value must be set to "cm_". (CO-174).

example database.php for MySQL
var $default = array(
 'driver' => 'Database/Mysql',
 'persistent' => false,
 'host' => 'localhost',
 'login' => 'registry_user',
 'password' => 'a good password goes here',
 'database' => 'registry',
 'prefix' => 'cm_',
 );
example database.php for PostgreSQL
var $default = array(
 'driver' => 'Database/Postgres',
 'persistent' => false,
 'host' => 'localhost',
 'login' => 'registry_user',
 'password' => 'a good password goes here',
 'database' => 'registry',
 'prefix' => 'cm_',
 );

Install Database Schema

When running this step under v0.9.4, you may notice deprecation messages like

Deprecated (16384): Validation::notEmpty() is deprecated.

These messages may be safely ignored, and will be addressed in a future release (CO-1119).

 

Set up the database schema.

In order to avoid problems with file ownership, you should run console commands as the web server user. Otherwise, make sure the cache directory (wherever app/tmp points to) and all of its subdirectories and files are writeable by the web server. chown -R and chgrp -R may be in order after running console commands.

$ cd app
$ su -c "./Console/cake database" ${APACHE_USER}
[...]
Database schema update successful

Error: Database connection "Mysql" is missing, or could not be created

This error indicates the command line php utility can't find the appropriate PDO library. Go back and make sure your PHP was built correctly.

Next: Registry Installation - Email

  • No labels