The problem is that the order of clauses in your create database 
statement is wrong. The USER <name> and PASSWORD <password> clauses must 
follow *immediately* after the `CREATE <database-spec>`. See also [1]. 
I'm unsure why this doesn't produce a different error though. As a 
secondary problem, in a create database clause, the password *must* be 
enclosed in single quotes.

Also, granting a user admin role in the security database, only makes 
that user admin in the security database. It does not grant global admin 
rights (which is why you need to grant create database as well). As 
documented in [2]:
"""
If the GRANT ADMIN ROLE clause is specified, the new user account is 
created with the privileges of the RDB$ADMIN role in the security 
database (security2.fdb). It allows the new user to manage user accounts 
from any regular database he logs into, but it does not grant the user 
any special privileges on objects in those databases.
"""

So, steps to do this:

D:\DevSoft\Firebird\Firebird-3.0.5.33220-0_x64>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> connect 'localhost:employee' user sysdba password 'masterkey';
Database: 'localhost:employee', User: SYSDBA
SQL> create user macky password '1234' grant admin role;
SQL> grant create database to user macky;
SQL> commit;
SQL> create database 'localhost:e:\db\testcreatedb.fdb' user macky 
password '1234' default character set utf8;
SQL>

[1]: 
https://firebirdsql.org/file/documentation/reference_manuals/fblangref25-en/html/fblangref25-ddl-db.html
[2]: 
https://firebirdsql.org/file/documentation/reference_manuals/fblangref25-en/html/fblangref25-security-auth.html#fblangref25-security-auth-create-user

On 14-03-2020 18:07, Yannis Kozikopoulos jk...@freemail.gr 
[firebird-support] wrote:
> this is a new installation no existing databases no legacy code to support.
> 
> After installing the 64bit server on windows 7 machine file name
> Firebird-3.0.5.33220_0_x64.exe then do the following
> 
> c:> "c:\Program Files\Firebird\3_0\isql.exe"
> Use CONNECT or CREATE DATABASE to specify a database
> SQL> connect localhost:employee user sysdba password masterkey;
> Database: localhost:employee, User: SYSDBA
> SQL> create user macky password '1234' grant admin role;
> SQL>quit;
> 
> now I'm not interested in using sysdba for anything else just create my
> own super user and use that for everything.
> so next step create a new database
> 
> c:> "c:\Program Files\Firebird\3_0\isql.exe"
> Use CONNECT or CREATE DATABASE to specify a database
> SQL> create database 'localhost:D:\data\firebird\macky.fdb' default
> character set utf8 user macky password 1234;
> Statement failed, SQLSTATE = 28000
> Your user name and password are not defined. Ask your database
> administrator to set up a Firebird login.
> SQL>quit;
> 
> What the F? ok lets test that
> 
> c:> "c:\Program Files\Firebird\3_0\isql.exe"
> Use CONNECT or CREATE DATABASE to specify a database
> SQL> connect localhost:employee user macky password 1234;
> Database: localhost:employee, User: MACKY
> SQL> select Sec$User_name from sec$users;
> 
> SEC$USER_NAME
> ===============================
> MACKY
> 
> SQL> quit;
> 
> erm there is something I'm missing here lets try to grant the database
> create rights to the macky
> 
> C:> "c:\Program Files\Firebird\3_0\isql.exe"
> Use CONNECT or CREATE DATABASE to specify a database
> SQL> connect localhost:employee user sysdba password masterkey;
> Database: localhost:employee, User: SYSDBA
> SQL> grant create database to macky;
> Statement failed, SQLSTATE = 0A000
> unsuccessful metadata update
> -GRANT failed
> -feature is not supported
> -Only grants to USER or ROLE are supported for CREATE DATABASE
> SQL> grant create database to user macky;
> SQL>quit;
> 
> OK now that should do the trick, lets test it.
> 
> C:> "c:\Program Files\Firebird\3_0\isql.exe"
> Use CONNECT or CREATE DATABASE to specify a database
> SQL> create database 'localhost:D:\data\firebird\macky.fdb' default
> character set utf8 user macky password 1234;
> Statement failed, SQLSTATE = 28000
> Your user name and password are not defined. Ask your database
> administrator to set up a Firebird login.
> SQL>
> 
> I give up. any idea what I'm doing wrong here? for now I'm going to use
> one of the free gui admin tools in embedded mode but if the user
> management and stored proc thingy doesn't get better any time soon I'll
> drop firebird altogether.
> 
> thank you for your time. Your efforts are greatly appreciated regardless
> of outcome.

-- 
Mark Rotteveel
  • [firebird-support... Yannis Kozikopoulos jk...@freemail.gr [firebird-support]
    • Re: [firebir... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]

Reply via email to