Q:

Sails.JS 1.0.0: Connection to MariaDB does not work

I created an simple Sails.JS test app
sails new test-project

I simply want to test if the connection to my MariaDB which runs on my NAS works and if I can play around with it using the blueprint thing from Sails.JS.
I created an an simple database:

and an testuser:

I configured config/datastores.js as follow:
module.exports.datastores = {
  default: {
    adapter: 'sails-mysql',
    url: 'mysql://asd:asd@192.168.178.11:3306/asd'
  },
};

My config/models.js looks like:
module.exports.models = {
  migrate: 'safe',
  attributes: {
    createdAt: { type: 'number', autoCreatedAt: true, },
    updatedAt: { type: 'number', autoUpdatedAt: true, },
    id: { type: 'number', autoIncrement: true, },
  },

  dataEncryptionKeys: {
    default: 'XYZ='
  },

  cascadeOnDestroy: true
};

After all that was done I created an "API" file with:
sails generate api asd

which created my model file which in turn I completed with the following:
/**
 * Asd.js
 *
 * @description :: A model definition.  Represents a database table/collection/etc.
 * @docs        :: https://sailsjs.com/docs/concepts/models-and-orm/models
 */

module.exports = {

  attributes: {
      name: {
          type: 'string'
        }
  }

};

My expectation now was that I can use the REST API using Postman to see if the connection will work.
So i lifted the project and simply fired an GET request 
http://localhost:1337/asd/1

which yields the following error
AdapterError: Unexpected error from database adapter: `select` failed ("badConnection").  A connection either could not be obtained or there was an error using the connection.
Additional data:

{ error: 
   { Error: ER_HOST_NOT_PRIVILEGED: Host 'Markus-Desktop.fritz.box' is not allowed to connect to this MariaDB server
    at Handshake.Sequence._packetToError (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\mysql\lib\protocol\sequences\Sequence.js:48:14)
    at Handshake.ErrorPacket (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\mysql\lib\protocol\sequences\Handshake.js:101:18)
    at Protocol._parsePacket (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\mysql\lib\protocol\Protocol.js:280:23)
    at Parser.write (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\mysql\lib\protocol\Parser.js:73:12)
    at Protocol.write (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\mysql\lib\protocol\Protocol.js:39:16)
    at Socket.
<anonymous> (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\mysql\lib\Connection.js:96:28)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:594:20)
    --------------------
    at Protocol._enqueue (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\mysql\lib\protocol\Protocol.js:141:48)
    at Protocol.handshake (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\mysql\lib\protocol\Protocol.js:52:41)
    at PoolConnection.connect (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\mysql\lib\Connection.js:123:18)
    at Pool.getConnection (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\mysql\lib\Pool.js:45:23)
    at Object.getConnection (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\machinepack-mysql\machines\get-connection.js:78:25)
    at wrapper (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\@sailshq\lodash\lib\index.js:3250:19)
    at Deferred.parley.now.flaverr.name [as _handleExec] (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\machine\lib\private\help-build-machine.js:1068:17)
    at Deferred.exec (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\parley\lib\private\Deferred.js:679:10)
    at Deferred.switch (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\machine\lib\private\help-build-machine.js:1306:16)
    at spawnConnection (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails-mysql\helpers\private\connection\spawn-connection.js:29:10)
    at Object.spawnOrLeaseConnection (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails-mysql\helpers\private\connection\spawn-or-lease-connection.js:23:3)
    at Object.select (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails-mysql\helpers\select.js:122:24)
    at wrapper (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\@sailshq\lodash\lib\index.js:3250:19)
    at Deferred.parley.now.flaverr.name [as _handleExec] (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\machine\lib\private\help-build-machine.js:1068:17)
    at Deferred.exec (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\parley\lib\private\Deferred.js:679:10)
    at Deferred.switch (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\machine\lib\private\help-build-machine.js:1306:16)
    at Object.find (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails-mysql\lib\adapter.js:185:16)
    at _getPopulatedRecords (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\waterline\lib\waterline\utils\query\help-find.js:145:21)
    at helpFind (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\waterline\lib\waterline\utils\query\help-find.js:582:6)
    at _afterPotentiallyRunningBeforeLC (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\waterline\lib\waterline\methods\find-one.js:265:9)
    at _maybeRunBeforeLC (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\waterline\lib\waterline\methods\find-one.js:239:16)
    at Deferred._.extend._WLModel [as _handleExec] (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\waterline\lib\waterline\methods\find-one.js:241:9)
    at Deferred.exec (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\parley\lib\private\Deferred.js:679:10)
    at Object.findOneRecord [as asd/findone] (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails\lib\hooks\blueprints\actions\findOne.js:37:4)
    at C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails\lib\router\bind.js:247:46
    at routeTargetFnWrapper (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails\lib\router\bind.js:391:9)
    at C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails\lib\router\bind.js:454:14
    at Layer.handle [as handle_request] (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\layer.js:95:5)
     code: 'ER_HOST_NOT_PRIVILEGED',
     errno: 1130,
     sqlState: undefined,
     fatal: true },
  meta: 
   { host: 'localhost',
     port: 3306,
     schema: true,
     adapter: 'sails-mysql',
     url: 'mysql://asd:asd@192.168.178.11:3306/asd',
     identity: 'default' } }
    at Object.findOneRecord [as asd/findone] (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails\lib\hooks\blueprints\actions\findOne.js:36:4)
    at C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails\lib\router\bind.js:247:46
    at routeTargetFnWrapper (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails\lib\router\bind.js:391:9)
    at C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails\lib\router\bind.js:454:14
    at Layer.handle [as handle_request] (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\layer.js:95:5)
    at next (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\route.js:137:13)
    at Route.dispatch (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\layer.js:95:5)
    at C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\index.js:281:22
    at param (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\index.js:354:14)
    at param (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\index.js:365:14)
    at Function.process_params (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\index.js:410:3)
    at next (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\index.js:275:10)
    at next (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\route.js:127:14)
    at Hook.expressMiddleware (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails\lib\hooks\i18n\index.js:205:14)
    at Hook.wrapper [as expressMiddleware] (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\@sailshq\lodash\lib\index.js:3250:19)
    at addLocalizationMethod (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails\lib\hooks\i18n\index.js:147:35)
    at routeTargetFnWrapper (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\sails\lib\router\bind.js:391:9)
    at Layer.handle [as handle_request] (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\layer.js:95:5)
    at next (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\route.js:137:13)
    at Route.dispatch (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\layer.js:95:5)
    at C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\index.js:281:22
    at param (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\index.js:354:14)
    at param (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\index.js:365:14)
    at Function.process_params (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\index.js:410:3)
    at next (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\index.js:275:10)
    at next (C:\Users\Markus\Programming\NodeJS\test-project\node_modules\express\lib\router\route.js:127:14)

I can use the asd-User to login using PHPMyAdmin but the connection from Sails-JS fails.
[EDIT-1]
I recreated the user including the permissions using PHPMyAdmin and this are the commands it executed 
CREATE USER 'asd'@'%' IDENTIFIED VIA mysql_native_password USING '***';
GRANT USAGE ON *.* TO 'asd'@'%' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
GRANT ALL PRIVILEGES ON `asd`.* TO 'asd'@'%' WITH GRANT OPTION;

[/EDIT-1]
[EDIT-2]
I tried to configure the IP from which my sails app connects to the database and the hostname. Both are not working, same exception as above.
CREATE USER 'asd'@'Markus-Desktop.fritz.box' IDENTIFIED VIA mysql_native_password USING '***';
GRANT USAGE ON *.* TO 'asd'@'Markus-Desktop.fritz.box' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
GRANT ALL PRIVILEGES ON `asd`.* TO 'asd'@'Markus-Desktop.fritz.box' WITH GRANT OPTION;

CREATE USER 'asd'@'192.168.178.34' IDENTIFIED VIA mysql_native_password USING '***';
GRANT USAGE ON *.* TO 'asd'@'192.168.178.34' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
GRANT ALL PRIVILEGES ON `asd`.* TO 'asd'@'192.168.178.34' WITH GRANT OPTION;

[/EDIT-2]

A:

The MariaDB instance on my NAS is running on port 3307 and not the configured 3306. Noticed that while reading the my.cnf of the DB instance.

