Related Entries

Jython is great
Oracle 9i skills and DB2
XP and SQL
Respecting SQL
Jython zxJDBC rocks!

« Python Boy
» Button maker

Quick Start: Firebird on Windows

Firebird is a great free database. In this article, I'll explain how to get started using it on Windows. Warning: extremely short instructions.

Why Firebird?

More information can be had from the novice guide.

I. Installation

Downloading FireBird and installing it is pretty straight forward - just run the installer. We will assume FireBird is installed in C:\Program Files\FireBird\. The version I used is 1.0.2-Release. My system is Windows XP Home Edition.

I’ll also assume you’ve FireBird running as a service.

II. Getting Started

  1. Change sysdba password. This is the master admin user. The default password is masterkey. It is much better to change it to something else! Here is the command prompt interaction demonstrating this. GSEC is a tool to manage security:
    
     "C:\Program Files\FireBird\bin\gsec.exe" -user sysdba -password masterkey
     GSEC> modify sysdba -pw pwd
     GSEC> quit
    
    Please note that I’ve set the password to pwd. Choose a stronger password.
  2. Try out the sample database. iSQL is the command line client you can use to run queries.
    
      "C:\Program Files\FireBird\bin\isql.exe" "C:\Program Files\FireBird\examples\employee.gdb" -u sysdba -p pwd
      SQL> SHOW TABLES;
      SQL> SELECT * FROM countries;
      SQL> EXIT;
    
  3. Create another user to connect to the database. This way, we don’t need to use admin user all the time. Here, I create a user called vsbabu with password vsb. Again, this password is way too weak - use your own strong password.
    
      "C:\Program Files\FireBird\bin\gsec.exe" -user sysdba -password pwd
      GSEC> ADD vsbabu -pw vsb -fname Vattekkat -mname Satheesh -lname Babu
      GSEC> quit
    
  4. Instead of playing with the sample database, we can create our own database. Here, we will create a new database, owned by the new user created in the previous step and add a new table. First, go to a folder where we want the database files to reside.
    
     "C:\Program Files\FireBird\bin\isql.exe"
      SQL> CREATE DATABASE 'httplogs.gdb' USER 'vsbabu' PASSWORD 'vsb';
      SQL> CREATE TABLE states (state_code VARCHAR(2) NOT NULL PRIMARY KEY, state_name VARCHAR(30) NOT NULL);
      SQL> INSERT INTO STATES (state_code, state_name) VALUES ('VA', 'Virginia');
      SQL> INSERT INTO STATES (state_code, state_name) VALUES ('MD', 'Maryland');
      SQL> SELECT * FROM states;
      SQL> COMMIT;
      SQL> EXIT;
    
    To connect back,
    
      "C:\Program Files\FireBird\bin\isql.exe" httplogs.gdb -u vsbabu -p vsb
    

Documentation is available from www.firebirdsql.org. You might also want to research contributed tools.

KInderbasDB is freely available to access FireBird from Python.

  1. Bah, and I came here to read about Phoenix :) If you're interested in light weight databases have you played with SQLite yet? It's unbelievably small (25,000 lines of code, a 125KB zip file for windows) and has a very impressive set of features. It's blazingly fast too.

    Posted by: Simon Willison on May 23, 2003 10:16 PM
  2. Simon - yes, I've used SQLite (http://vsbabu.org/mt/archives/2003/02/18/really_beginning_to_like_sqlite.html). I wouldn't call FireBird light-weight though. It implements really nice feature set. SQLite started getting pretty slow once my tables grew more than 150MB.

    I'm looking at FireBird as a replacement DB for Windows applications instead of using Access. Thought of SQLite too - still undecided. SQLite makes installation a no-brainer. I'm not sure about how it will handle large sets of data (like GIS data).

    Posted by: Babu on May 24, 2003 07:31 AM
  3. In your feeling how does BerkeleyDB fit in the mix
    with SQLite and Firebird?

    --Alan

    Posted by: alan haffner on May 28, 2003 12:00 PM
  4. I worked with Interbase 5.5 with >5 gigabyte sized databases. The engine has no problems with such large datasets - the only problem was slow HDD IO operations, since databases was split to 1GB chunks and spread on few machines. I think, that in the version 6 Borland made some progress and Firebird is even better.

    Posted by: zgoda on May 29, 2003 09:32 AM
  5. Thanks for the instructions, you have no idea how terribly BURIED these simple startup instructions are in the standard install. (case in point: grep -r masterkey /c/firebird/* ... returns nothing!) You're a lifesaver!

    Firebird folks, documentation is just so critical ... mysql will maintain an edge with the LAMP crowd if one can't drop it in and get started immediately...

    Posted by: Chuck on May 8, 2004 12:31 AM
  6. Link to Python database module is broken.
    It should be http://kinterbasdb.sourceforge.net/

    Posted by: Waldemar Osuch on May 24, 2004 09:38 AM
  7. hi venky,

    i would like to retrieve the user name and password for the firebird server.i got an application developed with Firebied as the db server.i would like to export all the tables from firebird to mysql server.

    i tried "C:\Program Files\Liebermans\Art Explorer\Firebird\bin\gsec.exe" -user sysdba -password masterkey-user sysdba -password masterkey at the run in windows.

    Please help me to retrieve the user name and password.

    Any ideas!

    Posted by: Sreekanth on July 16, 2004 07:34 PM
  8. Thank you so much for this page. I was getting nowhere with the kinterbasdb
    docs or with those of Firebird.

    One thing to update is that the standard Windows install, at least on XP, is now
    to "C:\Program Files\FireBird\Firebird_1_5\" so maybe you could amend the page a to reflect this.

    Thanks one more,

    Norman

    Posted by: Norman Winn on September 18, 2004 04:14 PM
  9. Hi Norman,

    The path you mention is the default Firebird 1.5 install dir, on all Windows versions. The path in the original text applies to Firebird 1.0.

    BTW, the official Firebird Quick Start Guide has been brought up to date and split in a 1.0 and a 1.5 version. So to anybody who needs more than the short but useful directions given here: you can find the guides (online HTML as well as PDF) at http://www.firebirdsql.org/index.php?op=doc&id=userdoc

    Greetings,
    Paul Vinkenoog
    (Firebird doc team member)

    Posted by: Paul Vinkenoog on September 26, 2004 08:40 AM
//-->