[horde] _create script

lists at nvethis.d2g.com lists at nvethis.d2g.com
Thu Mar 28 03:39:54 PST 2002

Well, I have dl'ed Horde 2.0 many times and it's always been there.  But, anyway, I attached the mysql_create script that you might try.
I run the command, mysql -p < mysql_create.sql to import it to mysql.  It should be located in /../horde/scripts/db/mysql_create.sql

Quoting Daniel Dochita <Daniel.Dochita at sibiu.rdsnet.ro>:

> Hello everyone. i need some help in creating my "_create" script from
> horde/scripts/db. I'm installing the horde software now and i' reading the
> INSTALL file that comes with horde and at step 2 i have a problem, i dont
> have the _create script in scripts/db.
> The next test is the advice that comes with INSTALL.
> -------Start Here------
> 2. Creating databases
>    The specific steps to create a preferences storage container depend
>    on which database you've chosen to use.
>    First, look in scripts/db/ to see if a "_create" script already
>    exists for your database. If so, you should be able to simply
>    execute that script as superuser in your database.
>    Be sure to change the default password, "horde", to something
>    else before creating the tables! (Remember to use this password
>    when you configure Horde in the next step.)
>    If such a script does not exist, you'll need to build your own, using
>    the files auth.sql, prefs.sql, and category.sql as a starting point.
>    If you need assistance in creating databases for a database for
>    which no "_create" script exists, you may wish to let us know on
>    the Horde mailing list.
> -------End Here--------
> So i need help to create the script. if anyone can give me any hints or
> examples i would realy appreciate. Thank you very much
> -- 
> Daniel Dochita
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> -- 
> Horde mailing list: http://horde.org/horde/
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org

-------------- next part --------------
# $Horde: horde/scripts/db/mysql_create.sql,v 2001/12/29 20:25:28 rich Exp $
# If you are installing Horde for the first time, you can simply 
# direct this file to mysql as STDIN:
# $ mysql --user=root --password=<MySQL-root-password> < mysql_create.sql
# If you are upgrading from a previous version, you will need to comment
# out the the user creation steps below, as well as the schemas for any
# tables that already exist.
# If you are upgrading from Horde 1.x, the Horde tables you have from
# that version are no longer used; you may wish to either delete those
# tables or simply recreate the database anew.

CONNECT mysql;

REPLACE INTO user (host, user, password)
    VALUES (
  -- IMPORTANT: Change this password!

REPLACE INTO db (host, db, user, select_priv, insert_priv, update_priv,
                 delete_priv, create_priv, drop_priv)
    VALUES (
        'Y', 'Y', 'Y', 'Y',
        'Y', 'Y'

# MySQL 3.23.x appears to have "CREATE DATABASE IF NOT EXISTS" and
# "CREATE TABLE IF NOT EXISTS" which would be a nice way to handle
# reinstalls gracefully (someday).  For now, use mysql_drop.sql first
# to avoid CREATE errors.


CONNECT horde;

CREATE TABLE horde_users (
    user_uid       varchar(255) not null,
    user_pass      varchar(32) not null,
    primary key (user_uid)


CREATE TABLE horde_prefs (
    pref_uid        char(255) not null,
    pref_scope      char(16) not null default '',
    pref_name       char(32) not null,
    pref_value      text null,
    primary key (pref_uid, pref_scope, pref_name)


CREATE TABLE horde_categories (
       category_id INT not null,
       group_uid VARCHAR(255) not null,
       user_uid VARCHAR(255),
       category_name VARCHAR(255) not null,
       category_data TEXT null,
       category_serialized SMALLINT DEFAULT 0 not null,
       category_updated TIMESTAMP,
       PRIMARY KEY (category_id)

CREATE INDEX category_category_name_idx ON horde_categories (category_name);
CREATE INDEX category_group_idx ON horde_categories (group_uid);
CREATE INDEX category_user_idx ON horde_categories (user_uid);
CREATE INDEX category_serialized_idx ON horde_categories (category_serialized);

CREATE TABLE horde_categories_categories (
       category_id_parent INT not null,
       category_id_child INT not null,
       PRIMARY KEY (category_id_parent, category_id_child)

GRANT SELECT, INSERT, UPDATE, DELETE ON horde_categories TO horde;
GRANT SELECT, INSERT, UPDATE, DELETE ON horde_categories_categories TO horde;


# Done!

More information about the horde mailing list