【问题标题】:Getting this error in run the hybrisserver在运行 hybrisserver 时出现此错误
【发布时间】:2016-01-13 22:27:58
【问题描述】:

log4j:ERROR 无法连接到 [localhost] 的远程 log4j 服务器。我们稍后再试。 错误 [WrapperSimpleAppMain] [DataSourceImpl] 连接到具有 url jdbc:mysql://localhost/monsoon_qa?useConfigs=maxPerformance&characterEncoding=utf8 的数据源的错误:用户 'monsoon'@'localhost' 拒绝访问数据库 'monsoon_qa' com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:用户“monsoon”@“localhost”拒绝访问数据库“monsoon_qa”

【问题讨论】:

  • 如果您真正提出问题并说出您迄今为止为解决此问题所做的尝试以及结果如何,人们更有可能回答。

标签: java eclipse hybris


【解决方案1】:

您似乎忘记授予配置为将 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,您可能需要做更多的事情,但对于开发设置,这应该可以帮助您开始。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-27
    • 1970-01-01
    • 2017-08-08
    • 2018-03-06
    • 2021-10-20
    相关资源
    最近更新 更多