Subject Re: [firebird-support] HELP: Error while trying to create file
Author Helen Borrie
At 12:30 PM 26/06/2009, you wrote:
>Hi everyone.
>I've installed Firebird 2.1 on my Ubuntu Linux box, and finally managed to get it running.
>
>(Installing it wasn't enough - I had to type "sudo dpkg-reconfigure firebird2.1-super" to get the service running, which the official documentation didn't make any mention of whatsoever(!), and required HOURS of frustrating googling to discover - but I digress)
>
>Point is, I am unable to create a database anywhere but the default location:
>
>---
>SQL> create database '~/test.fdb' user 'SYSDBA' password 'xxxxx';
>Statement failed, SQLCODE = -902
>I/O error for file "/home/infinity/test.fdb"
>-Error while trying to create file
>-Permission denied
>---
>
>The only way to get it working was to create the database in the standard location:
>
>---
>SQL> create database '/var/lib/firebird/2.1/data/test.fdb' user 'infinity' password 'xxxxx';
>SQL> exit;
>---
>
>...then MOVE it to where I wanted it, and launch isql-fb again:
>
>---
>SQL> connect /mnt/accumulator/Database/test.fdb user infinity password xxxxx;
>Database: /mnt/accumulator/Database/test.fdb, User: infinity
>SQL> show tables;
>There are no tables in this database
>SQL> exit;
>---
>
>So uhmm.....what gives, guys? Why can't I create databases in /mnt/accumulator/Database? The permissions are full across the board - look:
>
>---
>infinity@underling:~$ ls -l /mnt/ | grep accumulator
>drwxrwxrwx 1 infinity infinity 8192 2009-06-25 23:09 accumulator
>
>infinity@underling:~$ ls -l /mnt/accumulator/ | grep Database
>drwxrwxrwx 1 infinity infinity 0 2009-06-25 23:12 Database
>
>infinity@underling:~$ ls -l /mnt/accumulator/Database/ | grep test
>-rwxrwxrwx 1 infinity infinity 659456 2009-06-25 23:25 test.fdb
>---
>
>And yes, I know I changed usernames halfway through. That doesn't appear to make any difference.

Those are *your* permissions. They won't be useful when user 'firebird' is trying to gain access!

>Any help would be appreciated!

Time to figure out how you want your environment to be....any comments I make pertain to Linux. And, in response to your earlier wibble, the official builds don't cover Debian and its children and grandchildren, thanks to Debian's idiosyncratic rules about filesystems. That's why the Inst&Mig documentation won't help you every step of the way. However, there are a couple of Debian/Ubuntu enthusiasts who maintain various how-tos on the FAQ site. One or two are linked from the Doc Index at the main site.

On Linuxen, the recommended thing is to create a firebird group and put the 'firebird' user in it. If you have Classic installed, also put in this group any non-root users who will need to connect locally to databases. It doesn't apply to SS, since non-root users have no way to connect directly to databases.

Decide a location where you want databases to be. Make the firebird user the owner from its root down. Make sure that the firebird user has execute rights on the root directory of your database area. Group will need rw on the directories and database files. You'll have to do this in sudo as the firebird user's password is known only to the firebird user, i.e., the server process.

./heLen