Firebird databases come with a standard database superuser (SYSDBA).
For security reasons it is recommended to change the superuser password and create a designated database user for Darwin2.

Securing the firebird database access

In the example below, the password of the sysdba-user is changed to "myNewSysDbaPass" and a database user "MyDarwinUser" with password "MyDarwinPassword" is created. Please change the values as you like.

You can perform the following actions as soon as the firebird driver is installed.

  • Open a command shell (click Start/run and enter "cmd")
  • navigate to the firebird installation path (typ. enter "cd \program files\Firebird\Firebird_2_5\bin")
  • enter the following commands:
// Change the password of the firebird superuser
gsec -user SYSDBA -password masterkey -modify sysdba -pw myNewSysDbaPass 
// Create a new user
gsec -user sysdba -password myNewSysDbaPass -add MyDarwinUser -pw MyDarwinPassword
 
// Grant the new user Create-DB rights (necessary for firebird 3.x and higher)
isql -user SYSDBA -password myNewSysDbaPass
> Create Database 'localhost:C:\foo.fdb';
> commit;
> connect 'localhost:C:\foo.fdb';
> grant create database to user MyDarwinUser;
> exit;
del C:\foo.fdb
 

Setting custom DB username/password in Darwin

To tell Darwin to use a designated DB-username/password you have to

  • open the AdminTool
  • click on the icon in the right corner of the DB-Name field to brig up the db connection dialogue
  • click the "Use a custom database user" checkbox
  • enter the appropriate values (e.g. MyDarwinUser / MyDarwinPassword)

Make old database accessible to new user

If you created a database BEFORE setting up the new user, the new user has no rights to access this database. (In Darwin you would get the error message "Couldn't determine the database-version.")

The easiest way to grant access rights to the new user is to make a backup of the old database using the old user and restore it using the new user. This will make the new user the "owner" of the database.

To do so enter the following commands:

// Make a backup of the database
gbak -B -USER sysdba -PASSWORD myNewSysDbaPass "C:\ProgramData\Darwin2\Evolution2.fdb" "C:\ProgramData\Darwin2\Evolution2.fbk"
// Move the old database out of the way  (ATT: requires admin rights)
rename "C:\ProgramData\Darwin2\Evolution2.fdb" Evolution2_OldOwner.fdb
// restore database with new user
gbak -R -USER MyDarwinUser -PASSWORD MyDarwinPassword "C:\ProgramData\Darwin2\Evolution2.fbk" "C:\ProgramData\Darwin2\Evolution2.fdb"