“MariaDB Server is one of the most popular database servers in the world. It’s made by the original developers of MySQL and guaranteed to stay open source.” - mariadb.org

NOTE: Setting up and administering the database on your groov EPIC is only for advanced developers who are familiar with both Linux shell commands and database administration. Once you enable Secure Shell access, you are on your own and will have to solve any issues that arise through your own knowledge and online research. Opto 22 product support is limited to helping you reset the groov EPIC processor to factory defaults; our Product Support engineers cannot help you with programming, usage, or troubleshooting.

CAUTION: Before updating groov EPIC firmware, be sure you back up any files or applications you have created, including database table entries, as they will be deleted during the update. In addition, be aware that when you update EPIC firmware, your installation and MariaDB database setup will not be restored. You will need to repeat the steps in this guide after you have updated the firmware.

Installing MariaDB

  1. Log into shell and use apt to update the package repositories.
  2. Use apt to install mariadb.

If you just need a local database, installation is finished.
However, most applications need remote access which requires some additional steps:

Setting up Remote Access

  1. Run the following command:
    sudo nano /etc/my.cnf
  2. Make two changes to this file:
    • Change skip-networking to #skip-networking
    • Change bind_address = localhost to bind_address = 0.0.0.0
  3. Go back to groov Manage and open the database port on the groov EPIC firewall.
    1. Go to Home > Security > Firewall.
    2. Scroll down to the bottom, click the Add Rule button, and enter the following rule:
          Title: MariaDB
          Protocol: tcp/udp
          Port: 3306
          eth0: enabled
          eth1, wlan0, tun0: disabled
    3. Click OK to add the rule, and then click Save in the top right of the page to apply that new rule to the firewall.
    4. For groov RIO only One additional task to run MariaDB on RIO (not necessary on EPIC) is to set log file ownership:

      sudo touch /var/log/mysqld.err
      sudo chown mysql:mysql /var/log/mysqld.err
      sudo /etc/init.d/mysqld start


      Next we create a root password and grant access from any remote clients.

  4. Create the root password using the following command, setting your own password:
    mysqladmin -u root password "[my-root-password]";
  5. Add the root user that can have remote access to the database.
    1. Connect to the database from the command line:
      mysql -u root -p
    2. Type the password from step 4 to connect to the database.
    3. Type the following command, setting your own password for the database user:
      GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '[my-root-password]' WITH GRANT OPTION;
    4. Type EXIT and hit enter.
  6. Restart the databases to apply these changes.
    sudo /etc/init.d/mysqld restart

You can now test remote connectivity with your database administration software.

Top

EPIC Developer Overview Home