# Installation and administration

Download (version 2.2) (opens new window)

# 1 INSTALLATION

# 1.1 Installing on Windows

To install MamBase on Windows, just run the setup file mbsetup.exe

Operating system requirements

  • Windows Server 2016 and higher
  • Windows 10

Hardware requirements

  • The number of processor cores ≥ 4;
  • Processor frequency ≥ 2.0 GHz;
  • RAM ≥ 16 GB;
  • Hard disk space (SSD preferred) ≥ 128 GB.

Demo database deployment

Open terminal and change directory to bin (where mbase located) and execute the commands:

  1. Create the sntest1 demo database:
    mbase sntest1 -c create -p 3020

  2. Fill the database with demo data:
    mbase -p 3020 -q < ../samples.data/sntest1/prepare.sql

  3. Execute simple demo query:
    mbase -p 3020 -q "select name, lastname, age from person limit 10"

# 1.2 Installing on Linux

To install MamBase under Linux, it is enough to unzip the distributive package into any directory.

Operating system requirements

  • Linux x64
  • GNU library GLIBC 2.23 or higher

Hardware requirements

  • The number of processor cores ≥ 4;
  • Processor frequency ≥ 2.0 GHz;
  • RAM ≥ 16 GB;
  • Hard disk space (SSD preferred) ≥ 128 GB.

Demo database deployment

Open terminal and change directory to bin (where mbase located) and execute the commands:

  1. Create the sntest1 demo database:
    ./mbase sntest1 -c create -p 3020

  2. Fill the database with demo data:
    ./mbase -p 3020 -q < ../samples.data/sntest1/prepare.sql

  3. Execute simple demo query:
    ./mbase -p 3020 -q "select name, lastname, age from person limit 10"

# 2 ADMINISTRATION

The mbase program allows you to administer MamBase databases.

To work in terminal mode, you can use CLI (Command Line Interface) commands.

Also, mbase is a web server for remote administration using a standard web browser.

# 2.1 Command Line Interface

The mbase program (utility) provides a command line interface for basic database administration operations.

mbase [dbname] [options] 

OPTIONS:

--help   
 -h                  -- show this help 
   
--command=<command> 
 -c <command>  	     -- command:
                        create    - create new database and start server for it
                                    (dbname and port are required)
                        open      - start server for database specified
                                    (dbname and port are required)
                        close     - stop server of database specified
                                    (port is required)
                        backup    - backup database specified
                                    (port is required)
                        restore   - restore database specified
                                    (dbname, port and backuppath are required)
--port=<port>
 -p <port>     	     -- TCP port listened by server

--folder <path>      
 -f <path>           -- path to folder where database will be created
                        default is setuppath/data 
                        (c:/mambaseuni/data for windows)

--query="sqlcommand"
 -q "sql command"    -- execute SQL query against database specified
                        (port is required);
                        if query is omitted, it will be red
                        from standard input

-b <path>            -- backup path

-t                   -- terminate mbase background process

Usage 2:
mbase a              -- start admin panel

# Examples

# Creating and running a database

mbase sntest1 -c create -p 3020

By default, the database is created in the setuppath/data directory (c:/mambaseuni/data folder for windows).

If you need to create database in another directory, use parameter -f

mbase sntest2 -f d:\tmp -c create -p 3021

# Running the existing database

mbase sntest1 -c open -p 3020

# Closing the Database

mbase -c close -p 3020

# Running SQL query

mbase -p 3020 -q "select * from person limit 10"

# Running SQL query from file

mbase -p 3020 -q < query.sql

# 2.2 Database administrator Web Interface

Database administrator Web Interface will be available with MamBase 2.2

MamBase Admin is the database management application for MamBase DBMS. It supports all the functions necessary for managing MamBase: from writing simple SQL queries to developing complex databases. MamBase Admin supports Windows and Linuxoperation systems.

To run it on Windows you need to enter Start menu, in the folder MamBase click MamBase Аdmin. MamBase Admin Web application will start in your Web Browser.

To run the application under Linux, run the command

mbase a 

You can also launch the browser and type the URL: 127.0.0.1:8000

The program interface is presented by:

  • the main menu located at the top of the page;
  • the left panel containing the tree of management objects (databases, tables, columns, indexes): for example, the program provides a test database;
  • the query area that allows you to create and run each query in a separate tab;
  • the data area displaying query results.

To create databases and perform operations on the database objects, a context menu is provided containing commands for creating, changing, and deleting database objects. All changes made in the database are displayed in the object tree in the left pane.

To work with queries, a separate section of the Query menu has been created in MamBase Admin, which allows you to create, run, save, open saved queries, etc.

For your convenience, the Help section provides information resources to help you in working with this application.

# 2.3 The catalog structure

The unpacked installation contains the following directories

  • bin — DBMS server and client executable files, some libraries
  • data — folder in which the databases are created
  • include — C/C++ Header files
  • samples.c++ — С++ examples
  • samples.java — Java examples
  • samples.data — test database data