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++, open
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
The version that is available in the official Ubuntu 18.04 repositories
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
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.
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
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.
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;
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;
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;
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.
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
Check your firewall settings on the server.
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?
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
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.
Hi, the repository does work with UBuntu 18.04 Bionic
Look this:
Please check your system
Hi @angeloma , I am trying to install http://sourceforge.net/projects/firebird/files/firebird-linux-amd64/2.5.5-Release/FirebirdCS-2.5.5.26952-0.amd64.tar.gz/download in Linux Focal 20.04.02 and I receive message “Installation complet” after input password for SYSDBA but I cant see service running. Can you have a trick to check? ThankĀ“s