Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to Database Cube that uses MySQL database from PHP (using JDBC)

My database team has set up a database Cube using MySQL database. I need to connect to this Cube from PHP and get the data using MDX queries.

I can't find how to do that. Could someone please help me with this ASAP?

Reference document :- Creating Interactive OLAPApplications with MySQLEnterprise and Mondrian

like image 250
ilight Avatar asked Sep 11 '12 12:09

ilight


People also ask

Can we use PHP and MySQL together?

MySQL is a Relational Database Management System (RDBMS) that uses Structured Query Language (SQL). It is also free and open source. The combination of PHP and MySQL gives unmet options to create just about any kind of website – from a small contact form to large corporate portal.

How connect PHP with database in xampp?

Xampp is an open-source software developed by Apache Friends. The use of Xampp is to test the clients or your website before uploading it to the remote web server. To Connect php with MySQL database you need to install XAMPP which is an easy to install Apache distribution containing MariaDB, PHP, and Perl.


1 Answers

Your best option is to use Schema workbench to create the XML for your Cube

Reference

Schema Workbench download

MySQL Jdbc Driver

Most of the time people get a little bit stuck at first using the workbench, i highly recommend that before you use it, put the mysql jdbc driver inside the driver folder. That way the application will be able to connect to your database as soon as you open it for the first time.

After you puted your jdbc-driver-file.jar inside the driver folder:

1- Execute Schema Workbench (.sh on unix/linux based systems)

2- Go to Tools -> Preferences and setup your connection string:

  • driver class name: com.mysql.jdbc.Driver

  • connection string: jdbc:mysql://serverlocation:port/database

  • username: mysql user

  • password: password

3- Go to File -> Open and open your cube

4- Go to File -> New -> MDX Query

If you want a prettier view of your MDX query using jPivot you can use the bi server for testing.

like image 97
KoU_warch Avatar answered Sep 20 '22 09:09

KoU_warch