'Unable to start fresh wiki.js install on my virtual server

I am trying to install the latest wiki.js version 2.5.170 on my standalone virtual machine running Centos 7

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

Nodejs is also the latest.

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

DB block in the config.yml file:

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

When starting it up:

[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

I checked connecting to the DB(using the same info given on config.yml) through CLI and it connects fine.

What am I missing here?.



Solution 1:[1]

I was having the same error and found the problem is related to user definition in config.yml:

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

Solution 2:[2]

change the path to yours:storage: D:/soft/mywiki/wiki-js/data/database.sqlite

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Oscar Salazar
Solution 2 wqjzzgci