Установка Firebird 2.5 на Ubuntu server

Для установки Firebird 2.5.2 final необходимо подключить репозитарий (ppa) для различных версий Ubuntu
Итак, приступим:

sudo add-apt-repository ppa:mapopa

Обновим систему:

sudo apt-get update

Посмотрим что имеем из поддерживаемой ветки firebird 2.5:

apt-cache search firebird2.5-*

Имеем

  • super server
  • classic server
  • superclassic server
  • Для установки super server:

    sudo apt-get install firebird2.5-super

    Для установки classic server:

    sudo apt-get install firebird2.5-classic

    Для установки superclassic server:

    sudo apt-get install firebird2.5-superclassic

    Конфигурируем сервер, нужное выбрать

    sudo dpkg-reconfigure firebird2.5-super
    sudo dpkg-reconfigure firebird2.5-classic
    sudo dpkg-reconfigure firebird2.5-superclassic

    Говорим что главный пользователь у нас SYSDBA с паролем MASTERKEY
    Устанавливаем дополнительные файлы:

    sudo apt-get install firebird2.5-examples firebird2.5-dev

    Для заюзования стандартной базы employee.fdb, она лежит в /usr/share/doc/firebird2.1-examples/examples/empbuild/

    cd /usr/share/doc/firebird2.5-examples/examples/empbuild/
    sudo gunzip employee.fdb.gz
    sudo chown firebird.firebird employee.fdb
    sudo mv employee.fdb /var/lib/firebird/2.5/data/

    Соединяемся с базой иcпользуя isql-fb консоль:


    $ isql-fb
    SQL> connect "/var/lib/firebird/2.5/data/employee.fdb " user 'SYSDBA' password 'masterkey';
    always use localhost: in front in front of db path when using classic or superclassic in 2.5 this way the lock files and the shared memory segment will be owned by the 'firebird' user. Another alternative is to add yourself to firebird group

    $ sudo adduser `id -un` firebird
    Then connect to the db in superclassic or classic

    $ isql-fb
    SQL> connect "localhost:/var/lib/firebird/2.5/data/employee.fdb " user 'SYSDBA' password 'masterkey';
    If all is ok then you will have the message with what database connected and what user and ready to use sql prompt

    Database: "/var/lib/firebird/2.5/data/employee.fdb ", User: SYSDBA
    SQL>
    Now you can check the server version and the tables

    SQL> show tables;
    COUNTRY CUSTOMER
    DEPARTMENT EMPLOYEE
    EMPLOYEE_PROJECT JOB
    PROJECT PROJ_DEPT_BUDGET
    SALARY_HISTORY SALES

    SQL> show version;
    ISQL Version: LI-V2.5.0.* Firebird 2.5
    Server version:
    Firebird/linux Intel (access method), version "LI-V2.5.0.* Firebird 2.5"
    Firebird/linux Intel (remote server), version "LI-V2.5.0.* Firebird 2.5/tcp (eeepc)/P11"
    Firebird/linux Intel (remote interface), version "LI-V2.5.0.* Firebird 2.5 Release Candidate 2/tcp (eeepc)/P11"
    on disk structure version 11.1
    To create a new database

    SQL> create database "/var/lib/firebird/2.5/data/first_database.fdb" user 'SYSDBA' password 'SYSDBAPASSWORD';
    SQL> connect "/var/lib/firebird/2.5/data/first_database.fdb" user 'SYSDBA' password 'masterkey';
    Commit current transaction (y/n)?y
    Committing.
    Database: "/var/lib/firebird/2.5/data/first_database.fdb", User: SYSDBA
    SQL>
    If you want to create a simple table then insert 1-2 rows and select from it here is one example

    SQL> CREATE TABLE TEST (ID INT NOT NULL PRIMARY KEY, NAME VARCHAR(20));
    SQL> show tables;
    TEST
    SQL> INSERT INTO TEST VALUES (1, 'John');
    SQL> INSERT INTO TEST VALUES (2, 'Joe');
    SQL> select * from test;

    ID NAME
    ============ ====================
    1 John
    2 Joe
    To quit the isql-fb console type quit

    SQL> quit
    CON>;

    Если вы используете Ubuntu с графической оболочкой и хотите работать непосредственно напрямую с сервером, вам необходимо установить flamerobin:

    sudo apt-get install flamerobin

    После установки найти программу можно в меню Программирование-> FlameRobin(Applications->Programming-> FlameRobin)

    Для веб-сервера c PHP нужно установить php5 драйвер firebird'а:

    sudo apt-get install php5-interbase

    И перегрузить апач:

    sudo /etc/init.d/apache2 restart

    Если вам нужно установить PHP как средство администрирования Firebird Web Admin:

    sudo apt-get install git-core
    git clone git://github.com/mariuz/firebirdwebadmin.git
    mv firebirdwebadmin /var/www/firebirdwebadmin

    На этом все, откройте в браузере:http://localhost/firebirdwebadmin

    * Данная статья написана для версий Ubuntu до 16.04. Если вы хотите обновить статью до вашей текущей версии обратитесь к автору

    Оцените блог: 
    Средняя: 2.9 (220 оценки)

    Задать вопрос