Coders' Corner Search:
General :: Databases :: InterBase
Help with InterBase, Borland's open source database.

Articles:


Featured Article

Setup and create my first Firebird database on Windows?

Question:

How do I setup and create my first Firebird database on Windows?

Answer:

Follow these instructions:




##
## Setting up Firebird SQL server on Windows 2003 Server
##
## Setup, create user, create database, login
##
##
##
## I am sure this works fine on all other windows versions,
## I just happened to do this on Win2k3.
##
  1. Download and Install the Firebird application (as superserver and service) into %systemdrive%\fbsql I installed into d:\fbsql, and I will use this as my example, you may have another. I believe the default is c:\Program Files\Firebird SQL. When I installed I basically selected all the defaults except for my install path.
  2. after install start service

  3. Go to Start, Run, and open cmd promt:
    cd d:\fbsql
    bin\gsec -user sysdba -password masterkey -database
    localhost:d:\fbsql\security.fdb
  4. Once in GSEC... you have a prompt: GSEC>
    GSEC> Add dbuser -pw yourpassword -fname fullname
    GSEC> display
    GSEC> quit
  5. Next open the sample database:
    bin\isql localhost:d:\fbsql\examples\employee.fdb -u dbuser -p
    yourpassword
  6. Now lets create mydb, you now have a prompt: SQL>
    SQL>create database 'localhost:d:\fbsql\mydb.fdb';
    SQL>exit;
  7. You now have a new database created and you should be able to log in like so:
    d:\fbsql\bin\isql localhost:d:\fbsql\mydb.fdb -u dbuser -p yourpassword

    - OR - from a remote host (if you installed the client)

    pathto\isql servername:d:\fbsql\mydb.fdb -u dbuser -p yourpassword
NOTES:
-as I mentioned I used the non-default path for my server installation: d:\fbsql
-The main key for this to work for me was to use the 'host:path\to\file.fdb' syntax.
For example, the documentation stated simple commands like so:
gsec -user sysdba -password masterkey isql -u sysdba -p masterkey These did not work for me, I had to supply the host and db file for each to work. On gsec I had to supply the -database switch that specified the correct security database. So, my commands that worked:

gsec -user sysdba -password masterkey -database
localhost:d:\fbsql\security.fdb

isql localhost:d:\fbsql\mydb.fdb -u dbuser -p yourpassword