27 C
Texas
angeloma
Senior Writer and partner

How to install Firebird on Ubuntu 20.04/ 18.04?

Database management systems are sufficient for many kinds of projects. Of course, they abound with MySQL / MariaDB or PostgreSQL popular but there are also other very good and efficient ones like SQLite or Firebird. The latter is less known but equally efficient and sophisticated. Of course, its operation is more similar to SQLite than to the very robust MySQL / MariaDB. So in this post, I will show you how to install Firebird on Ubuntu 20.04 / 18.04.

Firebird is a relational database management system written in C++, opensource and based on Interbase version 6. It uses SQL language which makes its learning curve quite low. It is less known than the highly popular MySQL / MariaDB but also used in large projects for its efficiency.

On the other hand, some of the features of the application are the following:

  • It is scalable
  • Support the Client/Server architecture by TCP protocol.
  • Many drivers are available for various programming languages such as PHP, Java or C++.
  • Quite secure in user management.
  • Cross-platform. With installable binaries for Windows, Linux, BSD, Solaris, and others.

So I will teach you how to install it and we will take the opportunity to do some small tests with the application.

Install Firebird on Ubuntu 20.04 / 18.04

- Advertisement -

The version that is available in the official Ubuntu 18.04 repositories includes Firebird. But the included version is quite old and does not take advantage of the new features of the recent versions as the correction of quite critical bugs.

In the case of Ubuntu 20.04 already Firebird 3 is in the official repositories. That is, nothing needs to be added.

Only for Ubuntu 18.04:

Fortunately, we have a dedicated repository for Ubuntu 18.04, so let us get to work.

Open a terminal session or connect to your server using SSH and add the repository.

:~$ sudo add-apt-repository ppa:mapopa/firebird3.0

After it is added. Refresh the APT cache and install the necessary packages:

:~$ sudo apt update

For Ubuntu 20.04 / 18.04:

:~$ sudo apt firebird3.0-server
1.- Install Firebird on Ubuntu 20.04 /18.04
1.- Install Firebird on Ubuntu 20.04 /18.04

During installation, you will be informed that the default user is “SYSDBA”. Define a password for this main user. It has to be quite secure.

2.- Set a password for the default user
2.- Set a password for the default user

Once you have defined the password. All you have to do is reconfigure the package so that all the changes are properly applied.

:~$ sudo dpkg-reconfigure firebird3.0-server

And it is ready to use.

Working with Firebird on Ubuntu 20.04 / 18.04

To enter the Firebird administration console and start using commands, just execute:

:~$ sudo isql-fb
3.- Using Firebird
3.- Using Firebird

With this we will be able to execute commands. And to get out just use this other one:

> quit;

Before starting to create databases and tables, it is necessary to talk about one thing. Firebird can store and access your databases from anywhere SQLite style, but can also restrict the location of them.

To make it accessible from anywhere or from a specific directory, just edit its configuration file:

:~$ sudo nano /etc/firebird/3.0/firebird.conf

Leave it as it is in the image to allow access to the database from any directory. There you can set a restriction to a particular directory.

4.- Making some changes in the configuration file
4.- Making some changes in the configuration file

Save the changes and close the file. Then, to apply the changes, just restart the service.

:~$ sudo systemctl restart firebird3.0

Creating databases and tables

Now we can start creating new databases and tables.

First we connect again to the Firebird shell.

:~$ sudo isql-fb

And then, we proceed to create the new database with the following syntax:

:> create database ["database_path.fdb"] user ['user']password '[password]';

For example:

:> create database "/var/lib/firebird/3.0/data/first_database.fdb" user 'SYSDBA' password 'angelo123';

Then, to use it or rather to connect to it we use this other command:

:> connect "/var/lib/firebird/3.0/data/first_database.fdb" user 'SYSDBA' password 'angelo123';

Now we’re ready to start creating tables.

For this example I will create a table with only two fields.

:> CREATE TABLE STUDENT (ID INT NOT NULL PRIMARY KEY, NAME VARCHAR(25));

So, you can show all the tables by using this command:

:> show tables;
6.- Creating table with two columns
6.- Creating table with two columns

Now, I am going to insert some data. Just use the following command:

:> INSERT INTO STUDENT VALUES (1, 'Angelo');

And get the data:

:> select * from STUDENT;
7.- Using Firebird on Ubuntu 20.04 / 18.04
7.- Using Firebird on Ubuntu 20.04 / 18.04

As you can see being SQL language, the commands and operations are similar to MySQL / MariaDB and PostgreSQL.

Finally, you can show the installed version:

:> show version;
8.- Firebird on Ubuntu 20.04 / 18.04
8.- Firebird on Ubuntu 20.04 / 18.04

And that is it.

Conclusion

Firebird may not be popular but is considered by many projects for its efficiency. Being of the SQL family its commands are not so different from those of other better known programs such as MySQL or MariaDB. So we only have to work with it.

Share this post and join our Telegram Channel.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

7 COMMENTS

  1. Hi;
    Thank you. Thanks to you for the first time, I ran firebird 3.0 on a clean ubuntu server. Everything is perfect on the server command line. I get an error if I want to start the remote database. I deleted the line “#RemoteBindAddress = localhost” in firebird.conf. What more can I try besides?
    Error Message: “-Your user name and password are not defined. Ask your database administrator to set up a Firebird login.
    Details: GDS error code: 335544472 ”
    Server: 192.168.5.10:/var/lib/firebird/3.0/data/first_database.fdb
    User: SYSDBA
    Password: angelo123

  2. On Ubuntu 18 WSL v2 where I installing, have that :

    Setting up firebird3.0-server (3.0.5.33100.ds4-2ubuntu1) …
    Statement failed, SQLSTATE = HY000
    operating system directive mmap failed
    -Exec format error
    dpkg: error processing package firebird3.0-server (–configure):
    installed firebird3.0-server package post-installation script subprocess returned error exit status 1
    Processing triggers for man-db (2.8.3-2ubuntu0.1) …
    Processing triggers for ureadahead (0.100.0-21) …
    Processing triggers for systemd (237-3ubuntu10.41) …
    Errors were encountered while processing:
    firebird3.0-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    what is wrong?

  3. Hello Angeloma,

    On Ubuntu 18.04.5 LTS all the time, either FB 2.5 or 3.0 I get this:

    E: The repository ‘http://ppa.launchpad.net/mapopa/ppa/ubuntu bionic Release’ does not have a Release file.
    N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    ==
    What should be done in this case?
    Would be grateful for the help.
    Piotr

  4. Hi Angeloma,
    You have delivered wrong commands and instructions. There are no dedicated rep for 18.04, as mentioned above. Please update it or just remove at all, otherwise people spend time doing something pointless.

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article