node.js - 无法在我的虚拟服务器上启动新的 wiki.js 安装

标签 node.js centos7 mariadb-10.1 wiki.js

我正在尝试在运行 Centos 7 的独立虚拟机上安装最新的 wiki.js 版本 2.5.170

https://docs.requarks.io/install/linux

Nodejs 也是最新的。

[root@server101 wiki]# node -v
v14.0.0

config.yml 文件中的数据库 block :

db:
  type: mariadb    
  # PostgreSQL / MySQL / MariaDB / MS SQL Server only:
  host: localhost
  port: 3306
  user: myuser_wiki
  pass: xxxxxx
  db: myuser_wiki
  ssl: false

  # Optional - PostgreSQL / MySQL / MariaDB only:
  # -> Uncomment lines you need below and set `auto` to false
  # -> Full list of accepted options: https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options
  sslOptions:
    auto: true
    # rejectUnauthorized: false
    # ca: path/to/ca.crt
    # cert: path/to/cert.crt
    # key: path/to/key.pem
    # pfx: path/to/cert.pfx
    # passphrase: xyz123

  # SQLite only:
  # storage: path/to/database.sqlite

启动时:

[root@server101 wiki]# node server
Loading configuration from /home/myuser/wiki/config.yml... OK
2020-11-08T12:57:57.126Z [MASTER] info: =======================================
2020-11-08T12:57:57.129Z [MASTER] info: = Wiki.js 2.5.170 =====================
2020-11-08T12:57:57.129Z [MASTER] info: =======================================
2020-11-08T12:57:57.129Z [MASTER] info: Initializing...
2020-11-08T12:57:57.928Z [MASTER] info: Using database driver mysql2 for mariadb [ OK ]
2020-11-08T12:57:57.933Z [MASTER] info: Connecting to database...
2020-11-08T12:57:57.950Z [MASTER] error: Database Connection Error: ER_HOST_NOT_PRIVILEGED undefined:undefined
2020-11-08T12:57:57.950Z [MASTER] warn: Will retry in 3 seconds... [Attempt 1 of 10]
2020-11-08T12:58:00.954Z [MASTER] info: Connecting to database...
2020-11-08T12:58:00.958Z [MASTER] error: Database Connection Error: ER_HOST_NOT_PRIVILEGED undefined:undefined
2020-11-08T12:58:00.958Z [MASTER] warn: Will retry in 3 seconds... [Attempt 2 of 10]
2020-11-08T12:58:03.962Z [MASTER] info: Connecting to database...
2020-11-08T12:58:03.968Z [MASTER] error: Database Connection Error: ER_HOST_NOT_PRIVILEGED undefined:undefined
2020-11-08T12:58:03.968Z [MASTER] warn: Will retry in 3 seconds... [Attempt 3 of 10]
2020-11-08T12:58:06.970Z [MASTER] info: Connecting to database...
2020-11-08T12:58:06.975Z [MASTER] error: Database Connection Error: ER_HOST_NOT_PRIVILEGED undefined:undefined
2020-11-08T12:58:06.975Z [MASTER] warn: Will retry in 3 seconds... [Attempt 4 of 10]
2020-11-08T12:58:09.979Z [MASTER] info: Connecting to database...
2020-11-08T12:58:09.981Z [MASTER] error: Database Connection Error: ER_HOST_NOT_PRIVILEGED undefined:undefined
2020-11-08T12:58:09.982Z [MASTER] warn: Will retry in 3 seconds... [Attempt 5 of 10]
2020-11-08T12:58:12.983Z [MASTER] info: Connecting to database...
2020-11-08T12:58:12.988Z [MASTER] error: Database Connection Error: ER_HOST_NOT_PRIVILEGED undefined:undefined
2020-11-08T12:58:12.988Z [MASTER] warn: Will retry in 3 seconds... [Attempt 6 of 10]
2020-11-08T12:58:15.992Z [MASTER] info: Connecting to database...
2020-11-08T12:58:15.996Z [MASTER] error: Database Connection Error: ER_HOST_NOT_PRIVILEGED undefined:undefined
2020-11-08T12:58:15.996Z [MASTER] warn: Will retry in 3 seconds... [Attempt 7 of 10]
2020-11-08T12:58:18.999Z [MASTER] info: Connecting to database...
2020-11-08T12:58:19.002Z [MASTER] error: Database Connection Error: ER_HOST_NOT_PRIVILEGED undefined:undefined
2020-11-08T12:58:19.002Z [MASTER] warn: Will retry in 3 seconds... [Attempt 8 of 10]
2020-11-08T12:58:22.006Z [MASTER] info: Connecting to database...
2020-11-08T12:58:22.008Z [MASTER] error: Database Connection Error: ER_HOST_NOT_PRIVILEGED undefined:undefined
2020-11-08T12:58:22.009Z [MASTER] warn: Will retry in 3 seconds... [Attempt 9 of 10]
2020-11-08T12:58:25.013Z [MASTER] info: Connecting to database...
2020-11-08T12:58:25.020Z [MASTER] error: Database Connection Error: ER_HOST_NOT_PRIVILEGED undefined:undefined
2020-11-08T12:58:25.020Z [MASTER] warn: Will retry in 3 seconds... [Attempt 10 of 10]
2020-11-08T12:58:28.023Z [MASTER] info: Connecting to database...
2020-11-08T12:58:28.033Z [MASTER] error: Database Initialization Error: Host '127.0.0.1' is not allowed to connect to this MariaDB server

我通过 CLI 检查了与数据库的连接(使用 config.yml 上给出的相同信息),并且连接正常。

我在这里缺少什么?

最佳答案

我遇到了同样的错误,发现问题与 config.yml 中的用户定义有关:

db:
  # Don't use underscore here. It'll cause connection error undefined.
  # Try myuserwiki or any other one without underscore.
  user: myuserwiki

关于node.js - 无法在我的虚拟服务器上启动新的 wiki.js 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64738404/

相关文章:

json - Firebase 安全规则?

jenkins - 如何查看centos中是否安装了jenkins?

mysql - 解释查询返回不同结果

node.js - mongoDB 聚合的分页 [Node.js]

javascript - 下载文件时 Node 渲染进程消失

javascript - Sequelizejs belongsToMany 与 otherKey 的关系

CMake 3.18.0 找不到 libopenjpeg2

python - 连接到在 boot2docker 中运行的 python 服务器时出错(centos 容器 | Windows 7.1 主机)

mysql - 在 MariaDB v10.1.xx 中创建过程

mysql - InnoDB 设置修改对现有/新数据库的影响