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 Engine.
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
- Download the MySQL JDBC Driver from the MySQL website.
- Extract the JDBC driver JAR file from the downloaded file with the following
command:
tar zxvf mysql-connector-java-8.0.27.tar.gz
- Rename the JDBC jar file to
mysql-connector-java.jar
.mv mysql-connector-java-8.0.27-bin.jar mysql-connector-java.jar
- Copy the MySQL JDBC jar file to your host.This host must be the same host where you plan to assign the Streaming SQL Engine service role. The service roles are assigned as a next step when installing SQL Stream Builder as a service in Cloudera Manager.
You will be prompted to provide your password.scp <location>/mysql-connector-java.jar root@<your_hostname>:
- Access the host on your cluster.This host must be the same host where you have added the JDBC jar file.
You will be prompted to provide your password.ssh root@<your_hostname>
- 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
- Check if the MySQL connector is in the folder with
ls
command.
Creating MySQL/MariaDB database for SSB
- Access a host on your cluster.This host must be the same host where you plan to assign the Streaming SQL Engine service role. The service roles are assigned as a next step when installing SQL Stream Builder as a service in Cloudera Manager.
You will be prompted to provide your password.ssh root@<your_hostname>
- Log in as the
root
user to MySQL:mysql -u root -p Enter password:
- Create databases for the Streaming SQL
Engine:
CREATE DATABASE ssb_admin DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
- Grant all privileges for the
database:
GRANT ALL ON ssb_admin.* TO 'ssb_admin'@'%' IDENTIFIED BY '<password>';
- Confirm that you have created the Streaming SQL Engine
database:
SHOW DATABASES;