?
1. 预先在mysql中创建好数据库ofbiz及用户
create database ofbiz;
create database ofbizolap;
create database ofbiztenant;
use mysql;
create user [email protected];
update user set password=password("ofbiz") where user=‘ofbiz‘;
grant all privileges on *.* to [email protected] 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:?
? ? ?
?
?
?
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
原文:http://dinguangx.iteye.com/blog/2227367