Cmdlets for MySQL

Build 25.0.9434

Port Parameter (Connect-MySQL Cmdlet)

Specifies the port number used to connect to the MySQL server. This property supports both single-node and clustered environments. For clusters, you may specify a comma-separated list of ports that correspond to each server in the Server property.

Syntax

Connect-MySQL -Port string

Data Type

cstr

Default Value

"3306"

Remarks

This property defines the network port used to establish a connection to the MySQL database server. By default, MySQL uses port 3306.

If connecting to a high-availability or clustered setup, you may specify multiple ports as a comma-separated list. Each port should match the corresponding entry in the Server list.

Examples:

  • Single server: Port="3306"
  • Cluster: Port="3306,3307,3308" (matches Server="db1,db2,db3")
Note: If the port does not match the server’s configuration, the connection may fail. Ensure that the specified ports are open and reachable on the target hosts.

This is a required parameter.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434