Metawerx Java Hosting Small Logo

Metawerx Support - How to set up a remote FireBird connection

Downloading the tools

For these instructions, you will need:

  • plink on Windows, or ssh on Linux/Unix - to establish the tunnel - download here
  • a FireBird client, we recommend FireBird Maestro, or the FireBird command line client ISQL, which comes with FireBird
  • preferably a cable/ADSL connection - GUI admin tools are quite 'chatty' and access will be slow over dial-up

Download these tools before continuing.

Starting the tunnel

We provide access to FireBird over an SSH tunnel for security. You will need to start the tunnel before using connecting with your client.

On Windows, the tunnel is established using plink. On Linux, the ssh tool is used. These are both command line tools.

You will have been provided with:

  • a metawerx username, which will be referred to as metausername below
  • a metawerx password, which will be referred to as metapassword below
  • a firebird server name and port, which will be referred to servername:serverport below (eg: firebird.metawerx.net:3050)
  • your metawerx firebird database path, which will be referred to as databasepath below (eg: d:\firebird\data\DBNAME.FDB)

You will also use a new username for the SSH connection. This will always be the same as your normal metawerx username, but with ssh_ on the front. eg: ssh_neale

To start the tunnel, execute the following command on Windows:

plink -C -v -l ssh_metausername -pw metapassword -L 3051:servername:serverport ssh-meta1.metawerx.net

or on Linux:

ssh -Cv -L 3051:servername:serverport ssh_metausername@metawerx.net

Example, if your username is cassie, password cassiepass, server firebird.metawerx.net:3050, and you are using Windows, use the following command:

plink -C -v -l ssh_cassie -pw cassiepass -L 3051:firebird.metawerx.net:3050 ssh-meta1.metawerx.net

This will open a tunnel between your localhost port 3051, and our FireBird database server.

  • The first time you connect, or at other times we regenerate our key files, you will be asked to store the key in your cache. Answer "y" (yes) to continue.
  • All data transmitted through the tunnel will be encrypted by SSH
  • A prompt will appear, awaiting commands. Do not enter any commands - just leave the window open and minimize it.
  • When you close this window, the tunnel will be closed, and your connection will be lost
  • FireBird uses port 3050 by default - we are using port 3051 to avoid conflicts with any local version of FireBird already running on your machine
  • You are now ready to start your FireBird GUI or command line client
  • If you want to know how this works, or are creating your own tunnel, see the SSH Tunnel page for a full explanation


Using FireBird Maestro

  • Ensure the tunnel is running, then start FireBird Maestro
  • In the Database menu, click Create Database Profiles
  • Enter the following details:
    • Host name: localhost:3051
    • Database file: your metawerx database path, eg: d:\firebird\data\NEALE.FDB
    • Character Set: <your choice, such as ASCII, UNICODE, SHIFT_JIS>
    • User name: your metawerx username
    • Role: <leave blank>
    • Password: your metawerx password
  • Click Next
  • A new window appears, tick the box that says: <X> Always capitalize database object names
  • Leave other options as they are, click Ready
  • Your new database profile now appears in the left panel, double click it to open
  • If an error appears saying Client Library gds32.dll not found, you must install the Client Tools for FireBird before continuing, and make sure the gds32.dll library is added to the Windows System folder (or another appropriate location). Note however, that it is still possible to execute statements and browse the database, so this doesn't seem to have too much effect.
  • If an error appears saying Failed to establish a connection, but the connection then has a Disconnect option, just ignore it. This error sometimes seems to appear incorrectly when establishing a connection with Firebird Maestro and doesn't seem to have any effect.
  • You should be able to now run queries and modify your table structure

Using the FireBird command line client ISQL

  • Open a Command Prompt on Windows, or a new shell on Linux
  • If necessary, CD to the folder where the command line tools are located (the <firebird-install>/bin folder)
  • Enter the following command:
isql
  • This will display something similar to the following:
Use CONNECT or CREATE DATABASE to specify a database
SQL>
  • Now enter the following connection command, substituting your real username/password/databasepath (your databasepath will be the same as your username plus .FDB, unless you have multiple databases)
SQL> connect "localhost/3051:databasepath" user 'USERNAME' password 'PASSWORD';
  • Example, if your username is cassie, password is cassiepass, database path is d:\firebird\data\CASSIE.FDB:
SQL> connect "localhost/3051:d:\firebird\data\CASSIE.fdb" user 'cassie' password 'cassiepass';
  • ISQL will respond with:
Database:  "localhost/3051:d:\firebird\data\CASSIE.fdb", User: cassie
  • You are now ready to enter SQL commands, which must end with a semicolon. Try the following command to see all tables in your database:
SQL> show tables;
  • Exit SQL mode with the command quit; (with the semicolon)

See Also

--Neale Rudd

navigation
metawerx specific
search
Share
tools
help

referring pages

Share