3.3.3. The list packages Command

list packages [package_name] site_name

This command lists registered packages. It requires a single argument, that being the name of the site with which the packages are registered, as shown in this example:

mcm> list packages mysite;
+-------------+---------------------------------------+-----------------+
| Package     | Path                                  | Hosts           |
+-------------+---------------------------------------+-----------------+
| yourpackage | /usr/local/ndb-host-10                | tonfisk         |
|             | /usr/local/ndb-host-20                | flundra         |
| mypackage   | /usr/local/mysql                      | tonfisk,flundra |
+-------------+---------------------------------------+-----------------+
3 rows in set (1.07 sec)

If tonfisk and flundra are Windows hosts, the list of packages might look something like this:

mcm> list packages mysite;
+-------------+---------------------------------------+-----------------+
| Package     | Path                                  | Hosts           |
+-------------+---------------------------------------+-----------------+
| yourpackage | c:/cluster/ndb-host-10                | tonfisk         |
|             | c:/cluster/ndb-host-20                | flundra         |
| mypackage   | c:/mysql                              | tonfisk,flundra |
+-------------+---------------------------------------+-----------------+
3 rows in set (1.07 sec)

In the example just shown, yourpackage uses the MySQL Cluster binaries installed at C:\cluster\ndb-host-10 on host tonfisk, and at C:\cluster\ndb-host-20 on flundra; mypackage uses MySQL Cluster binaries installed at C:\mysql on both hosts.

The output contains three columns; these are described in the following list:

You can filter the results so that information relating to only a single package is displayed by supplying the package name before the site name, as shown here:

mcm> list packages yourpackage mysite;
+-------------+---------------------------------------+-----------------+
| Package     | Path                                  | Hosts           |
+-------------+---------------------------------------+-----------------+
| yourpackage | /usr/local/ndb-host-10                | tonfisk         |
|             | /usr/local/ndb-host-20                | flundra         |
+-------------+---------------------------------------+-----------------+
2 rows in set (0.55 sec)

(See Section 3.3.1, “The add package Command”, for the add package commands that were used to create yourpackage.)

When a package contains MySQL Cluster installations using different base directories on different hosts, each unique combination of path and host is shown in its own row. However, the name of the package is displayed in the first row only; all rows that immediately follow this row and that do not contain the package name also relate to the same package whose name is shown in the first preceding row to display a package name. For example, consider the list packages command and output shown here:

mcm> list packages mysite;
+-------------+---------------------------------------+---------+
| Package     | Path                                  | Hosts   |
+-------------+---------------------------------------+---------+
| yourpackage | /usr/local/ndb-host-10                | tonfisk |
|             | /usr/local/ndb-host-20                | flundra |
| mypackage   | /usr/local/mysql                      | tonfisk |
|             | /usr/local/bin/mysql                  | flundra |
+-------------+---------------------------------------+---------+
3 rows in set (1.07 sec)

This output shows that there are two packages defined for the site named mysite; these packages are named yourpackage and mypackage. The package yourpackage consists of the MySQL Cluster binaries in the directory /usr/local/ndb-host-10 on host tonfisk, and in the directory /usr/local/ndb-host-20 on host flundra. The package named mypackage consists of the MySQL Cluster binaries in the directory /usr/local/mysql on host tonfisk, and in the directory /usr/local/bin/mysql on host flundra.

If you omit the site_name argument, the command fails with an error, as shown here:

mcm> list packages;
ERROR 6 (00MGR): Illegal number of operands