Subject Re: [firebird-support] new installation - cannot create new databases
Author Helen Borrie
At 07:50 AM 16/08/2009, you wrote:
>I have firebird 2.1 SuperServer installed on an Ubuntu 9.04 i386 based machine with employee.fdb located in my /home/brent directory.
>
>I can access employee.fdb locally with flameRobin and with isql-fb. I can also access it remotely from a second machine
> Engine Code : 335544344
> Engine Message :
> I/O error for file "/home/brent/ws/data/scubiedb.fdb"
> Error while trying to create file
> Permission denied
>
>The message is the same when I try to create the database
>remotely.

With SS, the user firebird must have permissions (rwx) in any directory where it is going to create databases or update them. Furthermore, the only "local" connection available will be a TCP/IP one through the localhost server. Some people create a purposed /data partition for storing databases; some store them in purposed branch of /var; others create a home directory for the firebird user; but, wherever you decide to store them, you need to take care of the filesystem permissions before trying to access them.

>If I forget the GUI clients and try isql from the
>command line.
>
>sudo isql-fb
>
> SQL> create database /home/brent/xxx.fdb page_size 8192 length 1000 user sysdba password xxxxxxx
> CON> default character set iso8559_1;
>
>it responds,
>
> Statement failed, SQLCODE = -104
> SQL error code = -104
> -Token unknown
> SQL>
>
>At first I thought I was making a mistake with the gui applications but isql fails too, so I think something is wrong with Firebird.

Nope. In isql you have to use correct syntax for DDL statements such as CREATE DATABASE (including single quotes around string arguments, natch!) The protocol and filesystem rules apply (isql is merely a client app) so, if libfbclient.so is the client library found by isql, you won't be able to do a direct-connect or create. First fix up the filesystem permissions so that the firebird user can create files in your home directory, then do:

SQL> create database 'localhost:/home/brent/xxx.fdb' page_size 8192 user 'sysdba' password 'xxxxxxx'
CON> default character set iso8559_1;

The length argument has no context here (if you're interested, you could study up what it's used for). In the past it would be treated as a no-op when used out of context, but I'm not certain that is still the case. In the interests of clean coding, just don't include it.

Another strong tip - especially if you are making libfbembed.dll available for accessing your databases locally - is to create a firebird group. Include in that group not just the user firebird but also your own userid (and those of anyone else who needs to access databases this way).

./heLen