Sample Header Ad - 728x90

MariaDB CONNECT engine to read external mongodb collections

-1 votes
1 answer
181 views
I want to access MongoDB collections through MariaDB 10.4.17. Both are installed on my local machine running Windows 10. |Software|listening port| |--------|-------| |MongoDB | 27017 | |MariaDB | 15501 | I installed the MariaDB Connect Engine using INSTALL SONAME 'ha_connect'; on the MariaDB CLI The collection I want to access is named receptors and has documents like these
{
  "_id" : 1,
  "taste" : "Umami",
  "receptor_name" : "mGluR4",
  "uniprot_id" : "Q14833"
}
this is the create table statement I used on mariadb
CREATE TABLE receptors (
  _id varchar(24) NOT NULL,
  taste varchar(64) DEFAULT NULL,
  receptor_name varchar(64) DEFAULT NULL,
  uniprot_id varchar(64) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=utf8mb4
  CONNECTION='mongodb://localhost:27017'
  table_type=MONGO tabname='receptors' data_charset=utf8
The table was created, but when I execute SELECT * FROM receptors I get this error:
ERROR 1296 (HY000): Got error 174 'Error 126 loading module jvm.dll: The specified module could not be found. ' from CONNECT
I fixed it by giving a path to JVM like this
set global connect_jvm_path="C://Program Files//Java//jdk-12.0.1//bin//server"
Next error I got is this which I am unable to figure out
ERROR 1296 (HY000): Got error 174 'ERROR: class wrappers/Mongo3Interface not found!' from CONNECT
I have the JavaWrappers file here: C:\Program Files\MariaDB 10.4\lib\plugin It should contain the Mongo3Interface but does not. I have no idea what I am doing wrong, and the MariaDB documentation isn't much help.
Asked by DB guy (69 rep)
Jan 25, 2021, 06:47 PM
Last activity: Jan 30, 2021, 12:51 PM