当前位置: 首页 > 工具软件 > Mondrian > 使用案例 >

Mondrian xml服务mysql_导入Mondrian例子数据库到mysql中 windows环境

穆鸿卓
2023-12-01

1.获取需要的jar包 下载mondrian:

http://sourceforge.net/projects/mondrian/files/mondrian/mondrian-3.0.3.11016/

加压至C:\mondrian 拷贝C:\mondrian\lib下的mondrian.war到tomcate下的webapps下 重启tomcat.自动加载webapps - mondrian.war 拷贝D:\apache-tomcat-6.0.32\webapps\mondrian\WEB-INF\lib下所有jar包到C:\mondrian\lib 2.准备数据库 安装好mysql数据库 创建database foodmart create database foodmart; grant all privileges on *.* to 'foodmart'@'localhost' identified by 'foodmart'; 3.使用mondrian自带的工具导数据到数据库中

java -cp "C:\mondrian-embedded\WEB-INF\lib\mondrian.jar;C:\mondrian-embedded\WEB-INF\lib\log4j-1.2.8.jar;C:\mondrian-embedded\WEB-INF\lib\eigenbase-resgen.jar;C:\mondrian-embedded\WEB-INF\lib\eigenbase-xom.jar;C:\mondrian-embedded\WEB-INF\lib\eigenbase-properties.jar;C:\mondrian-embedded\WEB-INF\lib\mysql-connector-java-5.1.17-bin.jar" mondrian.test.loader.MondrianFoodMartLoader -verbose -tables -data -indexes -jdbcDrivers=com.mysql.jdbc.Driver -inputFile=F:\mondrian-3.3.0.14703-embedded\demo\FoodMartCreateData.sql -outputJdbcURL="jdbc:mysql://localhost:3306/foodmart?user=foodmart&password=foodmart"

其中如果jar包的版本不一样,直接把jar包的版本去掉即可。 运行几分钟,就创建好了。 如:Finished load at: Fri May 25 00:07:53 CST 2012就表示导完了。 4.检查 mysql> show databases; +--------------------+ | Database           | +--------------------+ | information_schema | | foodmart           | | mysql              | | performance_schema | | test               | +--------------------+ 5 rows in set (0.00 sec) mysql> use foodmart Database changed mysql> show tables; +-------------------------------+ | Tables_in_foodmart            | +-------------------------------+ | account                       | | agg_c_10_sales_fact_1997      | | agg_c_14_sales_fact_1997      | | agg_c_special_sales_fact_1997 | | agg_g_ms_pcat_sales_fact_1997 | | agg_l_03_sales_fact_1997      | | agg_l_04_sales_fact_1997      | | agg_l_05_sales_fact_1997      | | agg_lc_06_sales_fact_1997     | | agg_lc_100_sales_fact_1997    | | agg_ll_01_sales_fact_1997     | | agg_pl_01_sales_fact_1997     | | category                      | | currency                      | | customer                      | | days                          | | department                    | | employee                      | | employee_closure              | | expense_fact                  | | inventory_fact_1997           | | inventory_fact_1998           | | position                      | | product                       | | product_class                 | | promotion                     | | region                        | | reserve_employee              | | salary                        | | sales_fact_1997               | | sales_fact_1998               | | sales_fact_dec_1998           | | store                         | | store_ragged                  | | time_by_day                   | | warehouse                     | | warehouse_class               | +-------------------------------+ 37 rows in set (0.00 sec) mysql> 说明一切OK了。 接下来就可以直接使用CUBE文件FoodMart.xml了。

 类似资料: