Firebird Documentation IndexIsql - Interactive SQL → Creating a database
Firebird Home Firebird Home Prev: Connecting to a databaseFirebird Documentation IndexUp: Isql - Interactive SQLNext: Setting the ISC_USER and ISC_PASSWORD environment variables

Creating a database

To create a database interactively using the isql command shell, get to a command prompt in Firebird's bin subdirectory and type isql (Windows) or ./isql (Linux):

C:\Program Files\Firebird\Firebird_2_0\bin>isql↵Use CONNECT or CREATE DATABASE to specify a database

To create a database named monkey.fdb and store it in a directory named test on your C drive:

SQL>CREATE DATABASE 'C:\test\monkey.fdb' page_size 8192↵ CON>user 'SYSDBA' password 'masterkey';↵

Note

In the CREATE DATABASE statement it is mandatory to place quote characters (single or double) around path, username and password.

When running Classic Server on Linux, if the database is not started with a hostname, the database file will be created with the linux login name as the owner. This may cause access rights to others who may want to connect at a later stage. By prepending the localhost: to the path, the server process, with Firebird 2.0 running as user firebird, will create and own the file.

To test the newly created database type:

SQL>SELECT * FROM RDB$monkey;↵

To get back to the command prompt type QUIT or EXIT.

Note

The above technique, as demonstrated, works, but ideally metadata objects should be created and maintained using data definition scripts.

Prev: Connecting to a databaseFirebird Documentation IndexUp: Isql - Interactive SQLNext: Setting the ISC_USER and ISC_PASSWORD environment variables
Firebird Documentation IndexIsql - Interactive SQL → Creating a database