本人系統環境 html
os x 10.9 、jdk1.六、mysql5.5 java
一、在官方網站上下載ofbiz 版本12.02 mysql
下載地址 http://www.apache.org/dyn/closer.cgi/ofbiz/apache-ofbiz-12.04.02.zip sql
二、對下載文件進行解壓 數據庫
進入到 ~/apache-ofbiz/framework/entity/config 目錄下打開 entityengine.xml apache
修改數據庫信息: post
使用mysql數據庫 網站
<delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false"> <!-- <group-map group-name="org.ofbiz" datasource-name="localderby"/> <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> --> <group-map group-name="org.ofbiz" datasource-name="localmysql"/> <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/> <!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> --> </delegator> <delegator name="default-no-eca" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" entity-eca-enabled="false" distributed-cache-clear-enabled="false"> <!-- <group-map group-name="org.ofbiz" datasource-name="localderby"/> <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> --> <group-map group-name="org.ofbiz" datasource-name="localmysql"/> <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/> <!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> --> </delegator> <!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "ant run-install" before running "ant run-tests" --> <delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main"> <!-- <group-map group-name="org.ofbiz" datasource-name="localderby"/> <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> --> <group-map group-name="org.ofbiz" datasource-name="localmysql"/> <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/> <!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> --> </delegator>
<datasource name="localmysql" helper-class="org.ofbiz.entity.datasource.GenericHelperDAO" field-type-name="mysql" check-on-start="true" add-missing-on-start="true" check-pks-on-start="false" use-foreign-keys="true" join-style="ansi-no-parenthesis" alias-view-columns="false" drop-fk-use-foreign-key-keyword="true" table-type="InnoDB" character-set="utf8" collate="utf8_general_ci"> <read-data reader-name="tenant"/> <read-data reader-name="seed"/> <read-data reader-name="seed-initial"/> <read-data reader-name="demo"/> <read-data reader-name="ext"/> <inline-jdbc jdbc-driver="com.mysql.jdbc.Driver" jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true" jdbc-username="ofbiz" jdbc-password="ofbiz" isolation-level="ReadCommitted" pool-minsize="2" pool-maxsize="25" time-between-eviction-runs-millis="600000"/><!-- Please note that at least one person has experienced a problem with this value with MySQL and had to set it to -1 in order to avoid this issue. For more look at http://markmail.org/thread/5sivpykv7xkl66px and http://commons.apache.org/dbcp/configuration.html--> <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> --> </datasource>
修改數據庫編碼: this
character-set="utf8" collate="utf8_general_ci"
localmysqlolap和localmysqltenant 修改和 localmysql修改內容相同 編碼
在mysql中建立三個Database,建立的名字分別爲:ofbiz、ofbizolap、ofbiztenant
因爲本人在配置數據源時,使用默認的用戶名和密碼(ofbiz),因此在mysql新建用戶ofbiz(密碼也爲ofbiz),並賦全部權限。
三、添加mysql-connector-java-5.1.24-bin.jar包
將mysql-connector-java-5.1.24-bin.jar文件複製到~/apache-ofbiz/framework/entity/lib/jdbc 目錄下
四、到ofbiz根目錄
安裝命令
~$ ant load-demo
本人安裝話費了31分鐘
啓動
$ ant start打開遊覽器 輸入 http://127.0.0.1:8080/ecommerce/
對Ofbiz進行簡單的安裝完畢,後來到數據庫查看了一下表總共有849張~