Adding Firebird user accounts
Firebird allows the creation of many different user accounts.Each of them can own databases and also have various types of access to databases and database objects it doesn’t own.
Assuming you are connected to a database as SYSDBA
, you can add a user account as follows:
create user billyboy password 'TooLongFor8099Comfort';
The full range of user management commands is:
CREATE USER username <user_option> [<user_option> ...] [TAGS (<user_var> [, <user_var> ...]] [CREATE OR] ALTER {USER username | CURRENT USER} [SET] [<user_option> [<user_option> ...]] [TAGS (<user_var> [, <user_var> ...]] DROP USER username) [USING PLUGIN _plugin_name] <user_option> ::= PASSWORD 'password' | FIRSTNAME 'firstname' | MIDDLENAME 'middlename' | LASTNAME 'lastname' | {GRANT | REVOKE} ADMIN ROLE | {ACTIVE | INACTIVE} | USING PLUGIN plugin_name <user_var> ::= tag_name = 'tag_value' | DROP tag_name
Tags are optional key-value pairs that can be freely defined by the user.The key (tag name) must be a valid SQL identifier, the value a non-NULL
string of at most 255 bytes.
Only SYSDBA
and co-admins can use all these commands.Ordinary users can change their own parameters (such as password, name parts and tags, but not active/inactive) using ALTER USER name
or ALTER CURRENT USER
.It is not possible to change an account name.
Examples:
create user dubya password 'Xwha007_noma'
firstname 'GW' lastname 'Shrubbery';
create user lorna password 'Mayday_domaka'
tags (Street = 'Main Street', Number = '888');
alter user benny tags (shoesize = '8', hair = 'blond', drop weight);
alter current user set password 'SomethingEvenMoreSecretThanThis';
alter user dubya set inactive;
drop user ted;
For details on managing users through SQL, also see the Firebird 5.0 Language Reference, section SQL Statements for User Management.