Pentaho内置数据是hsql.数据库。那我们如何换掉移植成mysql?
思想:
移植的条件:
1.首先要有一个mysql数据。
2.将pentaho的启动配置连接到mysql上。
我现在做一个将pentaho5.0数据库移植的例子。我以win7系统为例子
1. 首先在biserver-ce\data\mysql5文件夹下将里面3个sql文件,在mysql下面运行。只要是pentaho5的解压就是3个文件。所以名字就不说了。
步骤是:登陆mysql –u –p
将sql文件导入:Source 加文件路径
2. 然后就是将pentaho 的启动配置连接到mysql。
所以一共修改6个xml文件。
biserver-ce/pentaho-solutions/system/applicationContext-spring-security-jdbc.xml
biserver-ce/pentaho-solutions/system/applicationContext-spring-security-hibernate.properties
biserver-ce/pentaho-solutions/system/hibernate/hibernate-settings.xml
biserver-ce/pentaho-solutions/system/simple-jndi/jdbc.properties
biserver-ce/tomcat/webapps/pentaho/META-INF/context.xml
biserver-ce/tomcat/conf/Catalina/localhost/pentaho.xml
配置文件1
biserver-ce/pentaho-solutions/system/applicationContext-spring-security-jdbc.xml
修改如下(红色部分位修改过的):
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url"
value="jdbc:mysql://localhost:3306/hibernate" />
<property name="username" value="hibuser" />
<property name="password" value="password" />
</bean>
配置文件2
biserver-ce/pentaho-solutions/system/applicationContext-spring-security-hibernate.properties
修改如下(红色部分位修改过的):
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/hibernate
jdbc.username=hibuser
jdbc.password=password
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
配置文件3
biserver-ce/pentaho-solutions/system/hibernate/hibernate-settings.xml
修改如下(红色部分位修改过的):
<config-file>system/hibernate/mysql5.hibernate.cfg.xml</config-file>
配置文件4
biserver-ce/pentaho-solutions/system/simple-jndi/jdbc.properties
修改如下(红色部分位修改过的):
SampleData/type=javax.sql.Datasource
SampleData/driver=com.mysql.jdbc.Driver
SampleData/url=jdbc:mysql://localhost:3306/sampledata
SampleData/user=pentaho_user
SampleData/password=password
Hibernate/type=javax.sql.DataSource
Hibernate/driver=com.mysql.jdbc.Driver
Hibernate/url= jdbc:mysql://localhost:3306/hibernate
Hibernate/user=hibuser
Hibernate/password=password
Quartz/type=javax.sql.DataSource
Quartz/driver=com.mysql.jdbc.Driver
Quartz/url= jdbc:mysql://localhost:3306/quartz
Quartz/user=pentaho_user
Quartz/password=password
Shark/type=javax.sql.DataSource
Shark/driver=com.mysql.jdbc.Driver
Shark/url=jdbc:mysql://localhost:3306/shark
Shark/user=sa
Shark/password=
SampleDataAdmin/type=javax.sql.DataSource
SampleDataAdmin/driver=com.mysql.jdbc.Driver
SampleDataAdmin/url=jdbc:mysql://localhost:3306/sampledata
SampleDataAdmin/user=pentaho_admin
SampleDataAdmin/password=password
配置文件5
biserver-ce/tomcat/webapps/pentaho/META-INF/context.xml
修改如下(红色部分位修改过的):
<Resource name="jdbc/Hibernate" auth="Container" type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5"
maxWait="10000" username="hibuser " password="password"
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/hibernate"
validationQuery="select 1" />
<Resource name="jdbc/Quartz" auth="Container" type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5"
maxWait="10000" username=" pentaho_user" password=" password "
driverClassName="com.mysql.jdbc.Driver"
url=" jdbc:mysql://localhost:3306/quartz"
validationQuery="select 1"/>
配置文件6
biserver-ce/tomcat/conf/Catalina/localhost/pentaho.xml
修改如下(红色部分位修改过的):
<Resource name="jdbc/Hibernate" auth="Container" type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5"
maxWait="10000" username="hibuser " password="password"
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/hibernate"
validationQuery="select 1" />
<Resource name="jdbc/Quartz" auth="Container" type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5"
maxWait="10000" username=" pentaho_user" password=" password "
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/quartz"
validationQuery="select 1"/>
这样一个数据库就一直成功了。
然后启动pentaho平台。在浏览器输入:localhost:8080/pentaho就会进去像第一节的页面就说明一直成功。