Skip to content

Initializer

init(hostname:port:username:password:database:tlsConfiguration:)

Create a MySQLConfiguration for connecting to a server with a hostname and optional port.
init(hostname: String, port: Int = Self.ianaPortNumber, username: String, password: String, database: String? = nil, tlsConfiguration: TLSConfiguration? = .makeClientConfiguration())

Parameters

hostname

The hostname to connect to.

port

A TCP port number to connect on. Defaults to the IANA-assigned MySQL port number (3306).

username

The username to use for the connection.

password

The pasword (empty string for none) to use for the connection.

database

The default database fr the connection, if any.

tlsConfiguration

An optional TLSConfiguration specifying encryption for the connection.