Skip to content

MySQL Connection String

Builds a MySQL connection URI from individual parameters. It assembles host, port, database, username, and password, and optionally appends charset and SSL mode as query parameters. The result is a single connection string suitable for use in downstream database operations.
Preview

Usage

Use this node when you need a properly formatted MySQL connection string constructed from separate input fields. Typical workflow: provide your database server details and credentials, then pass the resulting URI to nodes or services that accept a MySQL connection string.

Inputs

FieldRequiredTypeDescriptionExample
hostTrueSTRINGDatabase hostname or IP address.localhost
portTrueINTDatabase port number.3306
databaseTrueSTRINGName of the target database.mydb
usernameTrueSTRINGDatabase username.dbuser
passwordTruePASSWORDDatabase password.
charsetTrueSTRINGCharacter set for the connection. If left as the default, it will be omitted from the URI.utf8mb4
ssl_modeTrueDISABLED \| PREFERRED \| REQUIRED \| VERIFY_CA \| VERIFY_IDENTITYSSL connection mode. If left as the default (PREFERRED), it will be omitted from the URI.PREFERRED

Outputs

FieldTypeDescriptionExample
textSTRINGThe constructed MySQL connection string in URI form.mysql://dbuser:@localhost:3306/mydb?charset=utf8mb4
jsonSTRINGJSON metadata or error details. Empty on success; contains {"error": "..."} on failure.{"error": "Failed to construct connection string: ..."}
htmlSTRINGUnused for this node. Returns empty string.
xlsxBYTESUnused for this node. Returns empty bytes.
pdfBYTESUnused for this node. Returns empty bytes.

Important Notes

  • Charset and SSL mode are appended as query parameters only when different from their defaults (utf8mb4 for charset, PREFERRED for ssl_mode).
  • Special characters in username, password, or database are not URL-encoded by this node; ensure values are URI-safe or pre-encode them.
  • The output focuses on providing the connection URI in the first output; other outputs are empty unless an error occurs, in which case the second (json) output includes error details.
  • This node does not load or reference external stored credentials; it builds the URI strictly from the provided inputs.

Troubleshooting

  • Connection string contains unexpected characters: URL-encode username, password, or database if they include special characters (e.g., @, :, /, ?).
  • Downstream connection fails with SSL errors: adjust the ssl_mode to match your server configuration (e.g., REQUIRED, VERIFY_CA, or VERIFY_IDENTITY).
  • Authentication fails: verify username/password and ensure the user has access to the specified database and host.
  • Port or host unreachable: confirm network connectivity, firewall rules, and correct host/port values.
  • Received an error message in the json output: review the error text for clues (e.g., formatting or missing inputs), correct the inputs, and retry.