The MySQL team is proud to announce the general availability of version 8.0.24 of the MySQL Shell.
In addition to a considerable number of bugs fixed, the following changes were introduced.
Improved Command Line Integration
Integrating the shell functionality in DevOps operations is a key feature and this release has introduced a big improvement on this area being the most remarkable improvements the following:
- No longer need to execute APIs using the –execute (-e) command line argument: all of the data required for any API available in CLI can be defined through command line arguments (including lists).
- The data type conversion for the different parameters is based on the API metadata which guarantees a correct data type conversion when needed.
- Improved help system for CLI calls, the CLI help allows to identify:
- What objects expose API functions on the CLI interface.
- Which API functions are available for a specific object.
- The syntax required to execute an specific function.
- Support to expose MySQL Shell Plugin operations to the CLI interface.
The format for CLI operations is as follows:
1 |
mysqlsh [shell options] -- [CLI Options] |
To see which objects expose functionality to the CLI interface (including plugins) use:
1 |
mysqlsh -- --help |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
$ mysqlsh -- --help The following objects provide command line operations: cluster Represents an InnoDB cluster. dba InnoDB cluster and replicaset management functions. gui Plugin to manage the MySQL Database Service on OCI. rs Represents an InnoDB ReplicaSet. shell Gives access to general purpose functions and properties. util Global object that groups miscellaneous tools like upgrade checker and JSON import. |
To see which operations are available for a specific object use:
1 |
mysqlsh -- <object> --help |
1
2
3
4
5
6
7
8
9
10
11
12
13
|
$ mysqlsh -- dba --help The following operations are available at 'dba': check-instance-configuration Validates an instance for MySQL InnoDB Cluster usage. configure-instance Validates and configures an instance for MySQL InnoDB Cluster usage. configure-local-instance Validates and configures a local instance for MySQL InnoDB Cluster usage. ... |
To see the syntax required to call a specific function from CLI use:
1 |
mysqlsh -- <object> <function> --help |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
$ mysqlsh -- dba check-instance-configuration --help NAME check-instance-configuration - Validates an instance for MySQL InnoDB Cluster usage. SYNTAX dba check-instance-configuration [<instance>] [<options>] WHERE instance: An instance definition. RETURNS A descriptive text of the operation result. OPTIONS --mycnfPath=<str> Optional path to the MySQL configuration file for the instance. Alias for verifyMyCnf --verifyMyCnf=<str> Optional path to the MySQL configuration file for the instance. If this option is given, the configuration file will be verified for the expected option values, in addition to the global MySQL system variables. ... |
The general syntax to execute an operation from CLI is as follows:
1 |
mysqlsh [shell options] -- <object> <function> [function arguments] |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
$ mysqlsh root:@localhost:3308 -- util dump-schemas sakila world \ --output-url=my-dump \ --exclude-tables=sakila.payment,sakila.rental \ --exclude-tables=sakila.sales_by_film_category \ --exclude-tables=sakila.sales_by_store Acquiring global read lock Global read lock acquired Gathering information - done All transactions have been started Locking instance for backup Global read lock has been released Writing global DDL files Writing DDL for schema `world` Writing DDL for table `world`.`countrylanguage` Preparing data dump for table `world`.`countrylanguage` Data dump for table `world`.`countrylanguage` will be chunked using column `CountryCode` Preparing data dump for table `world`.`country` Data dump for table `world`.`country` will be chunked using column `Code` Preparing data dump for table `world`.`city` Data dump for table `world`.`city` will be chunked using column `ID` Preparing data dump for table `sakila`.`store` Data dump for table `sakila`.`store` will be chunked using column `store_id` Preparing data dump for table `sakila`.`city` Data dump for table `sakila`.`city` will be chunked using column `city_id` Preparing data dump for table `sakila`.`country` Data dump for table `sakila`.`country` will be chunked using column `country_id` Preparing data dump for table `sakila`.`customer` Data dump for table `sakila`.`customer` will be chunked using column `customer_id` Preparing data dump for table `sakila`.`actor` Data dump for table `sakila`.`actor` will be chunked using column `actor_id` Preparing data dump for table `sakila`.`category` Data dump for table `sakila`.`category` will be chunked using column `category_id` Preparing data dump for table `sakila`.`film_text` Data dump for table `sakila`.`film_text` will be chunked using column `film_id` Preparing data dump for table `sakila`.`film` Data dump for table `sakila`.`film` will be chunked using column `film_id` Preparing data dump for table `sakila`.`address` Data dump for table `sakila`.`address` will be chunked using column `address_id` Preparing data dump for table `sakila`.`language` Data dump for table `sakila`.`language` will be chunked using column `language_id` Preparing data dump for table `sakila`.`film_category` Data dump for table `sakila`.`film_category` will be chunked using column `film_id` Preparing data dump for table `sakila`.`staff` Data dump for table `sakila`.`staff` will be chunked using column `staff_id` Preparing data dump for table `sakila`.`film_actor` Data dump for table `sakila`.`film_actor` will be chunked using column `actor_id` Preparing data dump for table `sakila`.`inventory` Data dump for table `sakila`.`inventory` will be chunked using column `inventory_id` Writing DDL for table `world`.`city` Writing DDL for table `world`.`country` Running data dump using 4 threads. NOTE: Progress information uses estimated values and may not be accurate. Writing DDL for schema `sakila` Writing DDL for view `sakila`.`staff_list` Writing DDL for view `sakila`.`nicer_but_slower_film_list` Writing DDL for view `sakila`.`actor_info` Writing DDL for view `sakila`.`film_list` Writing DDL for view `sakila`.`customer_list` Writing DDL for table `sakila`.`store` Writing DDL for table `sakila`.`city` Writing DDL for table `sakila`.`country` Writing DDL for table `sakila`.`customer` Writing DDL for table `sakila`.`actor` Writing DDL for table `sakila`.`category` Writing DDL for table `sakila`.`film_text` Writing DDL for table `sakila`.`film` Writing DDL for table `sakila`.`address` Writing DDL for table `sakila`.`language` Writing DDL for table `sakila`.`film_category` Writing DDL for table `sakila`.`staff` Writing DDL for table `sakila`.`film_actor` Writing DDL for table `sakila`.`inventory` Data dump for table `world`.`city` will be written to 1 file Data dump for table `world`.`countrylanguage` will be written to 1 file Data dump for table `world`.`country` will be written to 1 file Data dump for table `sakila`.`city` will be written to 1 file Data dump for table `sakila`.`store` will be written to 1 file Data dump for table `sakila`.`customer` will be written to 1 file Data dump for table `sakila`.`country` will be written to 1 file Data dump for table `sakila`.`actor` will be written to 1 file Data dump for table `sakila`.`category` will be written to 1 file Data dump for table `sakila`.`film_text` will be written to 1 file Data dump for table `sakila`.`address` will be written to 1 file Data dump for table `sakila`.`language` will be written to 1 file Data dump for table `sakila`.`film` will be written to 1 file Data dump for table `sakila`.`film_category` will be written to 1 file Data dump for table `sakila`.`staff` will be written to 1 file Data dump for table `sakila`.`inventory` will be written to 1 file Data dump for table `sakila`.`film_actor` will be written to 1 file 1 thds dumping - 100% (20.48K rows / ~20.45K rows), 0.00 rows/s, 0.00 B/s uncompressed, 0.00 B/s compressed Duration: 00:00:00s Schemas dumped: 2 Tables dumped: 17 Uncompressed data size: 1.03 MB Compressed data size: 117.59 KB Compression ratio: 8.7 Rows written: 20482 Bytes written: 117.59 KB Average uncompressed throughput: 1.03 MB/s Average compressed throughput: 117.59 KB/s $ |
For detailed information aobut this topic refer to the User Guide.
Dump & Load Enhancements
This time new compatibility options were added to allow de user determining what should be done on when a table without primary keys (which is a requirement for tables in MDS) are found on an On-Premise instance:
- ignore_missing_pks: will enable the dump process to skip the primary key verification
- create_invisible_pks: will cause the load process to automatically create the missing primary keys
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
mysql-py> util.dump_instance(prefix, {"osBucketName":"my-bucket", "osNamespace": "testing", "ocimds": True, "compatibility":["strip_restricted_grants", "ignore_missing_pks"]}) Acquiring global read lock Global read lock acquired Gathering information - done All transactions have been started Locking instance for backup Global read lock has been released Checking for compatibility with MySQL Database Service 8.0.24 ... NOTE: One or more tables without Primary Keys were found. This issue is ignored. This dump cannot be loaded into an MySQL Database Service instance with High Availability. ... |
For additional details refer to the compatibility options for the dump utilities in the User Guide.
Improved Logging
Troubleshooting execution of SQL statements also got an improvement by adding a new option that makes SQL operations to be logged into the system log:
- syslog on unix environments
- event log in windows environments
To enable this feature either set the shell option history.sql.syslog=true or start the MySQL Shell with the –syslog command line argument.
For additional details about this feature refer to the User Guide.
Resources
For details about the MySQL Shell please take a look at the MySQL Shell User Guide.
For additional details about features introduced by 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:
- MySQL Community Downloads website: https://dev.mysql.com/downloads/shell/
- GitHub: https://github.com/mysql/mysql-shell
Your feedback is very welcome!
You can reach us at #shell channel in https://mysqlcommunity.slack.com/