What is a MySQL connection string?

A MySQL connection string is a compact way to describe how to connect to a MySQL database — the host, port, credentials, database name, and connection options — in a single value that applications, command-line tools, and drivers can consume directly. Different tools expect different formats: a URL-style string (mysql://user:pass@host:port/db), a shell command for the mysql CLI client, or a JDBC URL for Java applications.

Manually assembling these strings is error-prone, especially when special characters in passwords need URL-encoding or when SSL options need to be appended correctly.

Tool description

MySQL Connect Link Generator builds ready-to-use MySQL connection strings from your host, port, credentials, database name, and SSL mode. It generates three formats simultaneously — a mysql:// connection URL, a mysql CLI command, and a JDBC URL — so you can copy whichever one your application or tool expects.

Examples

Input: host db.example.com, port 3306, username admin, password secret, database app, SSL mode REQUIRED

  • Connection URL: mysql://admin:secret@db.example.com/app?ssl-mode=REQUIRED
  • CLI command: mysql -h db.example.com -u admin -psecret --ssl-mode=REQUIRED app
  • JDBC URL: jdbc:mysql://db.example.com:3306/app?user=admin&password=secret&sslMode=REQUIRED

Features

  • Three output formats at once — connection URL, CLI command, and JDBC URL generated from a single set of inputs
  • SSL mode selection — choose from DISABLED, PREFERRED, REQUIRED, VERIFY_CA, or VERIFY_IDENTITY
  • Automatic encoding — usernames, passwords, and database names are URL-encoded where required

Options explained

Field Description
Host The database server hostname or IP address. Defaults to localhost.
Port The MySQL server port. Only included in the output if different from the default 3306.
Username / Password Optional credentials used to authenticate the connection.
Database name The name of the schema to connect to, if any.
SSL mode Controls how the connection negotiates TLS, from no encryption to full certificate verification.

Tips

  • Leave username, password, or database blank to generate a connection string without them.
  • Nothing is sent to a server — the strings are built entirely in your browser.