6.3.3. Creating a database as a non-privileged user

In Firebird 3, if you try to create a database other than in embedded mode as someone who is not a Firebird admin (i.e. SYSDBA or an account with equal rights), you may be in for a surprise:

  1. SQL>create database 'xnet://D:\data\mydb.fdb' user 'john' password 'lennon';
  2. Statement failed, SQLSTATE = 28000
  3. no permission for CREATE access to DATABASE D:\DATA\MYDB.FDB

Non-admin users must explicitly be granted the right to create databases by a Firebird admin:

  1. SQL>grant create database to user john;

After that, they can create databases.

Notice that with a serverless connection, i.e. without specifying a host name or protocol before the database name (and Engine12 enabled!), Firebird won’t deny any CREATE DATABASE statement. It will only fail if the client process doesn’t have sufficient rights in the directory where the database is to be created.