createdb - create database

SYNOPSIS

<createdb $db [$syspass [$publicpass [$methods]]]>


DESCRIPTION
The createdb function creates a new database whose path is given by $db. The passwords for _SYSTEM and PUBLIC are given as arguments (default empty if not specified).

The optional $methods argument controls the method(s) used to create the database's locking mechanism. It is the same format as the <sqlcp createlocksmethods> value (here). This parameter was added in version 7.00.1368636508 20130515.

Note that unlike the DB directive, which affects all other SQL commands, the database for createdb is specified at run time. Thus, createdb can be used in an administrative script to create new databases.


DIAGNOSTICS
createdb returns "Creating database succeeded" on success, or "Creating database failed" or nothing on error.


EXAMPLE

<createdb "/usr/local/mydb" "Klaatu!" "">


CAVEATS
The createdb function was added Oct. 10 1996. The $methods parameter was added in version 7.00.1368636508 20130515, when the $syspass and $publicpass parameters became optional as well; previous versions also required $syspass to be at least 6 characters and contain punctuation.

The path given to createdb is absolute, not relative to the HTML documents tree, and is not checked. It is up to the programmer to verify the path before calling createdb, e.g. to check whether the Web user is permitted to access the dir, etc.


SEE ALSO
adminsql


Copyright © Thunderstone Software     Last updated: Nov 1 2022
Copyright © 2022 Thunderstone Software LLC. All rights reserved.