在运行hybrisserver时出现此错误
问题描述:
log4j:错误无法连接到位于[localhost]的远程log4j服务器。我们稍后再试。 错误[WrapperSimpleAppMain] [DataSourceImpl]错误连接到具有url的数据源jdbc:mysql:// localhost/monsoon_qa?useConfigs = maxPerformance & characterEncoding = utf8:拒绝用户'monsoon'@'localhost'访问数据库'monsoon_qa' com .mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:拒绝用户'季风'@'localhost'到数据库'monsoon_qa'的访问在运行hybrisserver时出现此错误
答
看起来您忘记了授予适当的权限(或者根本没有创建用户? )被配置为将hybris连接到mysql。
你必须以某种方式创造这样的:
create database dbName CHARACTER SET utf8 COLLATE utf8_bin;
create user 'theUser'@'localhost' identified by 'thePassword';
grant all privileges on dbName.* to 'theUser'@'localhost';
在local.properties文件,你需要添加适当的mysql的配置,这样的事情:
db.url=jdbc:mysql://localhost/dbNAme?useConfigs=maxPerformance&characterEncoding=utf8&innodb_flush_log_at_trx_commit=0
db.driver=com.mysql.jdbc.Driver
db.username=theUser
db.password=thePassword
希望有所帮助。
注意这只是示例信息。如果你想为一个生产系统设置你的hybris,你可能需要做更多的事情,但是对于开发设置,这应该让你开始。
如果你真的提出一个问题并说出你迄今为止尝试解决这个问题以及结果是什么,那么人们更有可能回答问题。 –