Starting with SqlBak on Linux

The SqlBak application connects your Linux servers to sqlbak.com, allowing you to manage MySQL, PostgreSQL and MS SQL Server database backups from the web. It should successfully work on different Linux distributions such as Ubuntu, Debian, Fedora, CentOS and RHEL, but if you face any difficulty in using the app on your GNU/Linux distribution let us know.

Unattended SqlBak installation

To automatically install SqlBak, you can use a bash script that will add the SqlBak app package to the repository, install it and connect the application to SqlBak.com. To download and run the script, execute the following command:

curl -sSL https://sqlbak.com/download/linux/latest| sudo bash -s <your_secret_key>

Where <your_secret_key> is a 36-character key you see on the download page when you are logged in.

After that, your server will appear on the dashboard page.

Installation through the package manager

To install SqlBak you need to do several common steps. You need to execute a few commands according to your Linux distribution. First, you need to add a link to the app’s package to a repository list. Then, update the package manager and install the app.

Debian/Ubuntu

  1. Download package
    curl -o sqlbak.deb https://sqlbak.com/download/linux/latest/sqlbak.deb
  2. Install the app
    sudo apt-get install ./sqlbak.deb

RHEL/CentOS/OpenSUSE/Fedora/Oracle

  1. Install the app
    sudo rpm -Uvh https://sqlbak.com/download/linux/latest/sqlbak.rpm

Linux Mint

  1. Download package
    curl -o sqlbak.deb https://sqlbak.com/download/linux/latest/sqlbak.deb
  2. Install the app
    sudo apt-get install ./sqlbak.deb

Amazon Linux AMI

  1. Install the app
    sudo rpm -Uvh https://sqlbak.com/download/linux/latest/sqlbak.rpm

Kali Linux

  1. Download package
    curl -o sqlbak.deb https://sqlbak.com/download/linux/latest/sqlbak.deb
  2. Install the app
    sudo apt-get install ./sqlbak.deb

Photon OS

  1. Install the app
    sudo rpm -Uvh https://sqlbak.com/download/linux/latest/sqlbak.rpm

Testing

After the installation, it is good to check if the SqlBak service is successfully running:

sudo service sqlbak status

If everything is fine you should see something like this (pay attention to the green “active (running) text”):sqlbak service status

 

Server Registration

In order to see your computer on sqlbak.com’s dashboard, you need to register it as a server there. This is done with the following command:

sudo sqlbak -r -k <your_secret_key> [-n <desired_server_name>]

Where:

  • <your_secret_key> is a 36-character key you see on the download page when you are logged in
  • <desired_server_name> is a name you would like this computer to be named on sqlbak.com, if you omit this parameter the current hostname will be used

Adding a DBMS connection

Now it’s time to connect SqlBak to your DBMS:

sqlbak -ac -dt <database_type> -u <user_name> [-p <password>]

Where:

  • <database_type> can be MySQL, PostgreSQL or MS SQL
  • <user_name> is a DBMS user name
  • <password> is a password for the DBMS user

This command supports some additional optional parameters:

  • -ct specifies a connection type (default is TCP/IP)
  • -h specifies the host of the DBMS (default is localhost)
  • -P specifies a port to connect to the DBMS
  • -ssh allows connecting the DBMS through an ssh tunnel

To get more details about using these parameters and other useful commands read the command reference

After the connection is added you should see something like:

The connection has been successfully added. Connection-Id: 1, DBMS-Type: mysql, Connection-Name: localhost:3306

Adding a backup job

When you establish all necessary DBMS connections, you can go to the dashboard and add backup jobs for regular database backup.

14 thoughts on “Starting with SqlBak on Linux”

  1. Hello
    Please confirm if this lines are updated (see baseurl)

    sudo sh -c ‘echo ” \
    [sqlbakrepo] \
    name=Sqlbak Repository \
    baseurl=https://sqlbak.com/rpm/ \
    enabled=1 \
    gpgcheck=0″ >> /etc/yum.repos.d/sqlbak.repo’

    we have problems installing on CentOS

    Reply
  2. Hi, trying to add a database can I get:

    Handling a console command has failed. Failed to add DBMS connection. “/usr/bin/mysql: /etc/sqlbak/libtinfo.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libedit.so.2)
    mysql: [Warning] Using a password on the command line interface can be insecure.
    ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

    Can you advise please?

    Reply
  3. this sounds like a big security risk 🙂
    do i understand it right you get the username and password from the mysql server?
    i skip this one :-))

    Reply
  4. Thanks for your smart backup tool! I´m using docker for my postgresql database. But the docker image uses Alpine Linux. How would to install inside Alpine linux version?

    Kind regards

    Reply
  5. Deb repository not available.

    https://sqlbak.com/deb stable Release
    404 Not Found [IP: 209.133.198.58 443]
    Reading package lists… Done
    E: The repository ‘https://sqlbak.com/deb stable Release’ no longer has 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.

    Reply

Leave a Comment