Error: Credential not found: MySql

Describe the issue/error/question

I’m creating my own custom node, everything works well except when trying to add a credentials field to the parameters, something like:

> export class testSQL implements INodeType {
>     description: INodeTypeDescription = {
>         displayName: 'testSQL',
>         name: 'testSQL',
> ...
>         inputs: ['main'],
>         outputs: ['main'],
>         credentials: [
>             {
>                 name: 'MySql',
>                 required: true,
>             },
>         ],

I used the instructions provided at create-custom-nodes, to create my docker image (as indicated in the section " Use the n8n-nodes-module in production") but I guess I’m missing something, since the error Error: Credential not found: MySql appears every time that I load the node “testSQL”

A few questions:

  • Where should be located the file that declares the Credential “MySql”? (keep in mind that N8N_CUSTOM_EXTENSIONS is set to “/root/.n8n/custom”).
    I tried different locations with no luck
  • This might be related to the error that I get but I’m not clear where those changes should be made (what’s the path of those files)

Add the newly created node and the credential to the package.json file. Add "dist/nodes/Weather/Weather.node.js" to the nodes array in the n8n object (n8n.nodes ). Similarly, add "dist/credentials/WeatherApi.credentials.js" to the credentials array in the n8n object (n8n.credentials ).

Thanks

What is the error message (if any)?

Error: Credential not found: MySql

Please share the workflow

(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 0.184.0
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Hey @elg0ch0,

Welcome to the community :tada:

You would need to make a credential file in a credential folder, If you look at our starter repo we have an example of what the credentials would look like.

If you wanted to use the credentials from the current MySQL node you might be able to just change the credential name you have there to mySql.

1 Like