port [-dv] select --summary
port [-dv] select --show group
port [-dv] select [--list] group
port [-dv] select [--set] group option


port select provides a mechanism to choose from different implementations of a common tool or port. Selecting one of the options makes it the primary version or implementation, e.g. the one to be run by default when you do not explicitly select a version or implementation on the command line.

Note that port select is only for your convenience as user. It does not, for example, affect which compiler MacPorts uses when it compiles software, or against which copy of MySQL a port builds. If there is a user-visible choice, it is usually offered as a variant on the port. If the port select mechanism affects how a port builds, that should be considered a bug.

One example is the set of MySQL and forks of MySQL, where there are mysql51, mysql55, mysql56, mariadb, mariadb-10.0, mariadb-11.0, percona, possibly among others. port select lets you choose which of these becomes the version run, when you simply run mysql or other commands from the MySQL suite.

port select has multiple modes of operation: It can display a summary, show the current primary implementation and list all available implementations given a group name, and change the primary implementation. See OPTIONS below for details.



Display a summary of all available selection groups, their current primary implementation and a list of all available choices.

--show group

Print the current primary implementation for the given group.

--list group

Print a list of all currently available choices for the given group. This is the default when port select is called with one argument.

--set group option

Make option the primary selection for the group group. This is the default when port select is called with two arguments.


Please see the section GLOBAL OPTIONS in the port(1) man page for a description of global port options.


If you have both the mysql56 and the percona port installed, you can switch your implementation of the mysql command by running

$> sudo port select --set mysql $option

where $option is mysql56 if you want the version from MySQL, or percona, if you want the version from Percona.



(C) 2015 The MacPorts Project
Clemens Lang <>