Setting up MySQL/MariaDB database for SSB

After installing MySQL/MariaDB server, you must rename the JDBC connector, and create a database with credentials for SQL Stream Builder (SSB) to be able to install the service on your cluster. You also must install the MySQL Python connector to integrate with the Streaming SQL Console.

Before you begin

You need to install and configure MySQL or MariaDB based on which one you plan to use, before setting up the databases for SSB. To install and configure MySQL or MariaDB, you must complete the basic steps mentioned in the Private Cloud Base documentation.

Installing the MySQL JDBC connector

  1. Download the MySQL JDBC Driver from the MySQL website.
  2. Extract the JDBC driver JAR file from the downloaded file with the following command:
    tar zxvf mysql-connector-java-5.1.48.tar.gz
  3. Rename the JDBC jar file to mysql-connector-java.jar.
    mv mysql-connector-java-5.1.48-bin.jar mysql-connector-java.jar
  4. Copy the MySQL JDBC jar file to /usr/share/java folder using the following command.
    sudo mkdir -p /usr/share/java
    sudo cp <location>/mysql-connector-java.jar /usr/share/java
  5. Check if the MySQL connector is in the folder with ls command.

Creating MySQL/MariaDB database for SSB

  1. Log in as the root user to MySQL:
    mysql -u root -p
    Enter password:
  2. Create databases for the Streaming SQL Console:
    CREATE DATABASE ssb_admin DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  3. Grant all privileges for the database:
    GRANT ALL ON ssb_admin.* TO 'ssb_admin'@'%' IDENTIFIED BY '<password>';
  4. Confirm that you have created the Streaming SQL Console database:
    SHOW DATABASES;

Installing the MySQL Python connector

Use the following sample commands to install the correct version for MySQL:

RHEL

  1. Install the python-pip package:
    sudo yum install python3-pip
  2. Create a directory where you install the package:
    mkdir -p /usr/share/python3
  3. Install the 8.0.23 version for psycopg2 using pip:
    sudo pip3 install mysql-connector-python==8.0.23 -t /usr/share/python3

Ubuntu

  1. Install the python-pip package:
    sudo apt-get install python3-pip
  2. Create a directory where you install the package:
    mkdir -p /usr/share/python3
  3. Install the 8.0.23 version for psycopg2 using pip:
    sudo pip3 install mysql-connector-python==8.0.23 -t /usr/share/python3

SLES 12

  1. Install the python-pip package:
    sudo zypper install python3-pip
  2. Create a directory where you install the package:
    mkdir -p /usr/share/python3
  3. Install the 8.0.23 version for psycopg2 using pip:
    sudo pip3 install mysql-connector-python==8.0.23 -t /usr/share/python3