Skip to content

MySQL Connection String

Builds a MySQL database connection URI from individual parameters (host, port, database, username, password) with optional charset and SSL mode. Returns the full connection string in the text output slot; other outputs are left empty. This node does not attempt to connect to the database, it only formats the URI.
Preview

Usage

Use this node when you need a properly formatted MySQL connection string to pass into other database nodes or store as configuration. Typical workflow: provide your server details and credentials here, then feed the resulting URI to nodes that execute queries or tests.

Inputs

FieldRequiredTypeDescriptionExample
hostTrueSTRINGDatabase server hostname or IP address.localhost
portTrueINTTCP port the MySQL server listens on.3306
databaseTrueSTRINGTarget database name to connect to.mysql
usernameTrueSTRINGUsername for database authentication.root
passwordTruePASSWORDPassword for database authentication. This value is inserted into the URI.
charsetTrueSTRINGCharacter set to use. If left as the default 'utf8mb4', it will not be added to the URI.utf8mb4
ssl_modeTrueENUMSSL connection mode. Only added to the URI when different from the default.PREFERRED

Outputs

FieldTypeDescriptionExample
textSTRINGThe constructed MySQL connection URI in the form mysql://username:password@host:port/database[?charset=...&ssl_mode=...].mysql://root:@localhost:3306/mysql?ssl_mode=REQUIRED
jsonSTRINGEmpty output for this node.
htmlSTRINGEmpty output for this node.
xlsxBYTESEmpty output for this node.
pdfBYTESEmpty output for this node.

Important Notes

  • Security: The password is embedded in the URI. Avoid logging or displaying the resulting string in unsecured contexts.
  • Conditional parameters: 'charset' is only appended if it is not 'utf8mb4'; 'ssl_mode' is only appended if it is not 'PREFERRED'.
  • No connectivity check: This node does not verify the connection; it only formats the string.
  • Encoding: If your username or password contains special characters (e.g., @, :, /, ?), URL-encode them to ensure a valid URI.
  • Defaults: Defaults are host=localhost, port=3306, database=mysql, username=root, charset=utf8mb4, ssl_mode=PREFERRED.

Troubleshooting

  • Malformed URI or errors returned: Ensure host, port, and database are correct and that username/password are URL-encoded if they contain special characters.
  • Unexpected missing parameters in URI: Remember that charset=utf8mb4 and ssl_mode=PREFERRED are omitted by design; change them if you need them included.
  • Downstream node cannot connect: This node only formats the URI. Verify network access, credentials, and SSL settings in the environment where the downstream node executes.
  • Port out of range: Port must be between 1 and 65535.