Is there a way to import MySQL database into CQ5

pierrot10

01-07-2020

Hello

I am managing a CQ5 instance of my company. My company use CQ5 and offer a web site by group, but there is a lot of limitation

Following a need of my group, I create a PHP/MySQL database. The goal is to collect measures and store is into a MySQL database. The charts are shown into a PHP web page and I am using chartjs library Charts to display the charts.

I have to import my PHP script, database, and charts into CQ5 and I am really not an expert with CQ5.

My first question is, is there a way to import a MySQL database (which contain tables (and JOIN request) into CQ5?

My second question, as my PHP script, run MySQL requests, and show the charts because of javascript library, is there a chance to import all in CQ5 to have as a result, the same display as with my PHP script? If yes, could you help me to achieve this goal ?

Many thanks for your help!!

cq5 javascript mysql php

Accepted Solutions (1)

Accepted Solutions (1)

raj_mandalapu

01-07-2020

Based on your comments, you have lot of limitations and also you are not an expert in CQ5, so I prefer to use Iframe approach, using Iframe you can load your charts page directly on the AEM page. but you can also consider other options in case you need it.

There is no Out of the box functionality to Import SQL data directly into AEM, you need to write custom code, you need to export your table data into XML and the code which you write in CQ5 will read and import.

Another approach is, you can maintain data in MySQL, using JDBC connector , connect with MySQL, and write custom code to read table data using select statements. refer this: https://helpx.adobe.com/experience-manager/using/querying-mysql-64.html

Once you have table data then you can use chart.js to display charts in CQ5

 

 

 

Answers (1)

Answers (1)

Jörg_Hoh

Employee

03-07-2020

The product is no longer called CQ5 (that renmaing happend at least 5 years ago), so you probably do have a very old version of it running.

 

Regarding your question: Storing SQL data in the AEM repository is no good idea, as it is not designed for it. If your goal is to show the charts inside an AEM page, I would agree to the approach suggested by @raj_mandalapu and use an iframe to embed the output created by your PHP script.