1. 预先在mysql中创建好数据库ofbiz及用户
create database ofbiz; create database ofbizolap; create database ofbiztenant; use mysql; create user ofbiz@localhost; update user set password=password("ofbiz") where user='ofbiz'; grant all privileges on *.* to ofbiz@localhost identified by 'ofbiz';
2. 下载mysql驱动
./ant download-mySQL-JDBC
此命令会将mysql驱动包下载到framework/entity/lib/jdbc/目录
3. 更改entity配置
修改文件frarework/entity/config/entityengine.xml
3.1 配置mysql数据源连接,修改相关的字符集
character-set="utf8" collate="utf8_general_ci"
VI操作:
:% s/latin1_general_cs/utf8_general_ci/gc :% s/latin1/utf8/gc
3.2 将delegator中引用的datasource-name的值设置为 localmysql:
<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="localmysql"/> <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/> </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="localmysql"/> <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/> </delegator> <!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "ant load-demo" 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="localmysql"/> <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/> </delegator>
vi操作:
:% s/datasource-name="localderby/datasource-name="localmysql/gc
4. 数据初始化
./ant load-demo ./ant start
附: 如果是将数据库从derby升级为mysql,参考:
https://cwiki.apache.org/confluence/display/OFBIZ/How+to+migrate+OfBiz+from+Derby+to+MySQL+database
相关推荐
我自己写的一个ofbiz使用mysql配置的向导,更多交流http://www.guhao.org/?cat=6
Ofbiz 数据库全模型,不用到处找了,都已经全了。
NULL 博文链接:https://youngbrick.iteye.com/blog/2344086
ofbiz通过groovy操作数据库增删改查,groovy是一个类似于java的语言
ofbiz11数据库配置文档
WIN7上安装Ofbiz 数据库 postgresql 希望对大家有所帮助
Apache-Ofbiz-16-全量数据库873张表sql文件
ofbiz所有数据库表文档,描叙数据表及字段的Java Name,DB Name,Field Type,Java Type,Sql Type。可以作为研究Ofbiz数据库级学习Ofbiz的参考文档使用
Ofbiz 和 Mysql中文乱码解决方法.docx
封装,你可以在一个简单的 XML 文件中定义数据库表结构,Ofbiz 会自动帮你在数据库建表,并动态生成映射对象, 你在程序中可以只考虑对 Object 的处理,Ofbiz 会自动通过事务逻辑更新到数据库中。Ofbiz 宣称的优点之...
OFBiz开发者装备系列:0006
OFBIZ快速入门OFBIZ快速入门OFBIZ快速入门OFBIZ快速入门OFBIZ快速入门OFBIZ快速入门
ofbiz入门图文讲解,包括入门helloworld 和使用ofbiz 新建实体 操作数据库对实体增删改查
Ofbiz数据模型查询手册,Ofbiz开源系统的数据库模型。可以看看里面数据库表。
基于spring封装的ofbiz所有服务,使用spring security进行安全验证,可以方便的发布为微服务,同时实现了一套直接使用ofbiz实体引擎操作ofbiz所有数据库表的spring应用框架设计
里面是下载地址,如果逆向开发ofbiz,只要下载它就绝对没错了 Apache+OFBiz+开发初学者指南.rar OFBiz开发快速入门.rar OFBiz-技术文档.rar OFBiz API中文版.rar Apache OFBiz Cookbook Sep 2010.rar Opentaps ...
包括:自动安装mysql服务,设置ofbiz启动所需jre环境,生成桌面启动ofbiz server的快捷方式。 包含文件:winrar自解压启动文件install.bat及ofbiz的启动文件ant.bat及目录截图。 ofbiz及绿色版mysql和jre不在资源内...
小谈ofbiz学习,发展历史,学习体验和心得,以及ofbiz与其他框架的不同之处
ofbiz 10.04 共841张表,删除了一张test表.希望对广大ofbiz 学习者有用.