MySQL Blog Archive
For the latest blogs go to blogs.oracle.com/mysql
MySQL Shell 8.0.13 - What's New?

The MySQL Development team is proud to announce a new version of the MySQL Shell which in addition to the usual bug fixes and enhancements to the existing components,  offers new features we expect are quite useful in your day to day work.

The main additions on this release include:

  • Support for executing MySQL Shell (API) commands directly from the command line, without entering the interactive REPL interface.
  • Introduction of a JSON Import utility.

API Command Line Integration for DevOps

The MySQL Shell offers a set of components in the form of JavaScript and Python APIs which enable developers to create custom scripts to handle specific use cases.

In this release, we made possible to call the functionality on some of the global objects in an easy way without having to enter into the REPL interface.

This can be done by specifying the object, function name and function parameters as independent command line arguments.

The functionality integrated into the command line includes:

  • AdminAPI: the functions available in the dba and cluster global objects.
  • Credential Management: through the functions in the shell object.
  • Shell option handling, through the functions in the shell.options object.
  • Server Upgrade verification and JSON import through the utils object.

Help about this topic is available by executing the following command in an interactive session.

Stay Tuned: A blog post is coming with details about this feature!

JSON Import

A new utility has been introduced to ease the task of importing data into a MySQL Database either into a MySQL Document Store Collection or a traditional Table.

The data is loaded from a text file containing JSON documents and through different options, you can configure the target table or collection where the data will be loaded.

This utility is available at the util global object.

Importing data from a JSON file into the store.zips collection

Help about this topic is available by executing the following command in an interactive session.

For more details: take a look at Import JSON to MySQL made easy with the MySQL Shell.

Misc Enhancements

Existing components have been improved to support features and changes available on external components such as the Server and Group Replication.

Upgrade Checker

A new Server release comes with changes that impact the upgrade process from previous releases. The Upgrade Checker utility has been updated to keep the pace of changes and to fully report required changes when migrating to an 8.0.13 Server.

Upgrade Checker Utility for 8.0.13

AdminAPI

In 8.0.13, Group Replication introduces new features that improve the usability and configuration capability for InnoDB Clusters.

On the MySQL Shell side, the AdminAPI has been extended to fully support these new features. These changes include adding options to the dba.createCluster(…) and cluster.addInstance(…) functions to define:

  • A priority to be used when the new primary election process takes place in clusters running in single-primary-mode.
  • Allow defining the exit action for an instance that gets removed from an InnoDB Cluster.

For more details: take a look at MySQL InnoDB Cluster – What’s new in the 8.0.13 (GA) release.

Pager Support

Two common tasks in the shell include result dumping and help display. It is also common that, in both cases, the amount of text printed is long scrolls down until it is fully displayed. As a result, users need to scroll up to see the initial details of the output.

With pager support, the MySQL Shell can be configured so that the output is printed in parts.

With a configured pager, the user can see page by page and has control about when the next page should be printed or even if the printing should be aborted.

Shell using the ‘more’ command to paginate help output.

For more details about using this feature execute the following command at the MySQL Shell:

Additional information is also available on the MySQL Shell User Guide.

Connection Timeout

So far the MySQL Shell did not support establishing a connection timeout in any of the mechanisms available to establish a session. A new connection option has been introduced to support this, when no timeout is specified, a default timeout of 10 seconds will be used.

Details about the connection timeout are included on the different mechanisms to establish a session. Also you can execute the following command:

Resources

For details about the MySQL Shell please take a look at the MySQL Shell User Guide.

For additional details about features introduced at this version and the full list of fixed bugs take a look at the Release Notes.

Don’t forget to download it and give it a try, your feedback is very welcome!

You can reach us at #shell channel in https://mysqlcommunity.slack.com/