SlideShare a Scribd company logo
1 / 96
Frédéric Descamps
Community Manager
MySQL
MySQL Shell: Document Store & More
MySQL 8 is Great !
2 / 96
 
Safe Harbor
The following is intended to outline our general product direction. It is intended for information purpose only, and
may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality,
and should not be relied up in making purchasing decisions. The development, release, timing and pricing of any
features or functionality described for Oracle´s product may change and remains at the sole discretion of Oracle
Corporation.
Statement in this presentation relating to Oracle´s future plans, expectations, beliefs, intentions and ptospects
are "forward-looking statements" and are subject to material risks and uncertainties. A detailed discussion of
these factors and other risks that a ect our business is contained in Oracle´s Securities and Exchange
Commission (SEC) lings, including our most recent reports on Form 10-K and Form 10-Q under the heading
"Risk Factors". These lings are available on the SEC´s website or on Oracle´s website at
h p://www.oracle.com/investor. All information in this presentation is current as of September 2019 and Oracle
undertakes no duty to update any statement in light of new information or future events.
Copyright @ 2020 Oracle and/or its affiliates.
3 / 96
Who am I ?
Copyright @ 2020 Oracle and/or its affiliates.
4 / 96
Frédéric Descamps
@lefred
MySQL Evangelist
Managing MySQL since 3.23
devops believer
living in Belgium 🇧🇪
h ps://lefred.be
Copyright @ 2020 Oracle and/or its affiliates.
5 / 96
MySQL Shell
The MySQL Shell is an interactive Javascript, Python, or SQL interface supporting
development and administration for the MySQL Server and is a component of the MySQL
Server. You can use the MySQL Shell to perform data queries and updates as well as
various administration operations.
Copyright @ 2020 Oracle and/or its affiliates.
6 / 96
MySQL Shell (2)
The MySQL Shell provides:
Copyright @ 2020 Oracle and/or its affiliates.
7 / 96
MySQL Shell (2)
The MySQL Shell provides:
Both Interactive and Batch operations
Copyright @ 2020 Oracle and/or its affiliates.
8 / 96
MySQL Shell (2)
The MySQL Shell provides:
Both Interactive and Batch operations
Document and Relational Models
Copyright @ 2020 Oracle and/or its affiliates.
9 / 96
MySQL Shell (2)
The MySQL Shell provides:
Both Interactive and Batch operations
Document and Relational Models
CRUD Document and Relational APIs via scripting
Copyright @ 2020 Oracle and/or its affiliates.
10 /
96
MySQL Shell (2)
The MySQL Shell provides:
Both Interactive and Batch operations
Document and Relational Models
CRUD Document and Relational APIs via scripting
Traditional Table, JSON, Tab Separated output results formats
Copyright @ 2020 Oracle and/or its affiliates.
11 /
96
MySQL Shell (2)
The MySQL Shell provides:
Both Interactive and Batch operations
Document and Relational Models
CRUD Document and Relational APIs via scripting
Traditional Table, JSON, Tab Separated output results formats
MySQL Standard and X Protocols
Copyright @ 2020 Oracle and/or its affiliates.
12 /
96
MySQL Shell (2)
The MySQL Shell provides:
Both Interactive and Batch operations
Document and Relational Models
CRUD Document and Relational APIs via scripting
Traditional Table, JSON, Tab Separated output results formats
MySQL Standard and X Protocols
and more...
Copyright @ 2020 Oracle and/or its affiliates.
13 /
96
MySQL Shell Overview
PY
JS
SQL
>
MySQL 8.0
Upgrade Checker
Auto Completion
&
Command History
Output
Formats
(table, json, tabs)
Prompt
Themes
Batch
Execution
5.7
8.0
JS
Document
Store
X dev API
SQL CLI InnoDB
Cluster
importJSON
JSJS
parallel
importTABLE
data
Copyright @ 2020 Oracle and/or its affiliates.
14 /
96
setup your environment
Starting with MySQL Shell
Copyright @ 2020 Oracle and/or its affiliates.
15 /
96
Install MySQL Shell
the package's name to install is mysql-shell
you always need to use the latest available even with a lower MySQL Server version
latest version is 8.0.19, use it even with MySQL 5.7.x
Shell
Copyright @ 2020 Oracle and/or its affiliates.
16 /
96
Start a beautiful Shell
The default prompts is basic, we provide several di erent prompt examples.
# cp /usr/share/mysqlsh/prompt/prompt_256pl+aw.json ~/.mysqlsh/prompt.json
Then start the mysqlsh:
Copyright @ 2020 Oracle and/or its affiliates.
17 /
96
Start a beautiful Shell
The default prompts is basic, we provide several di erent prompt examples.
# cp /usr/share/mysqlsh/prompt/prompt_256pl+aw.json ~/.mysqlsh/prompt.json
Then start the mysqlsh:
Copyright @ 2020 Oracle and/or its affiliates.
18 /
96
Some configuration tips
These are some se ings I usually use:
mysql-js> shell.options.setPersist('history.autoSave', 1)
mysql-js> shell.options.setPersist('history.maxSize', 5000)
You can switch to all 3 di erent modes using:
py for Python
js for Javascript
sql for SQL
If you have a preferred mode, you can specify it like this:
mysql-js> shell.options.setPersist('defaultMode', 'sql')
Copyright @ 2020 Oracle and/or its affiliates.
19 /
96
Util
The MySQL Shell comes with a global object called util. This object is used to perform
some dedicated DBA tasks like:
Checking if the server's con guration and schema design is compatible with next
MySQL version (checkForServerUpdrade())
Importing JSON documents, like exports from MondoDB (importJSON())
Importing table dumps in parallel (importTable())
Con guring OCI pro le (con gureOCI())
Copyright @ 2020 Oracle and/or its affiliates.
20 /
96
Admin API
The Admin API is used to con gure MySQL instances to be part of a MySQL InnoDB
Cluster or a MySQL InnoDB ReplicaSet - NEW in 8.0.19.
It also creates and manage clusters.
More Info: h ps://lefred.be/content/mysql-innodb-cluster-from-scratch-even-more-
easy-since-8-0-17/
Copyright @ 2020 Oracle and/or its affiliates.
21 /
96
NoSQL
Copyright @ 2020 Oracle and/or its affiliates.
22 /
96
* CREATE
* READ
* UPDATE
* DELETE
col->add({title: 'MySQL is Great', author: 'lefred' })
col-> nd()
collection.modify('author = "lefred"').set('author',
'kenny')
col.remove('author = "lefred"')
MySQL supports JSON & CRUD operations
Copyright @ 2020 Oracle and/or its affiliates.
23 /
96
* CREATE
* READ
* UPDATE
* DELETE
col->add({title: 'MySQL is Great', author: 'lefred' })
col-> nd()
collection.modify('author = "lefred"').set('author',
'kenny')
col.remove('author = "lefred"')
MySQL supports JSON & CRUD operations
It's possible to use MySQL without a single line
of SQL !
Copyright @ 2020 Oracle and/or its affiliates.
24 /
96
Migration from MongoDB to MySQL DS
For this example, I will use the well known restaurants collection:
Copyright @ 2020 Oracle and/or its affiliates.
25 /
96
Migration from MongoDB to MySQL DS
For this example, I will use the well known restaurants collection:
Copyright @ 2020 Oracle and/or its affiliates.
26 /
96
Let's make a query
Copyright @ 2020 Oracle and/or its affiliates.
27 /
96
Let's make a query
That's too much records to show in here... let's limit it
Copyright @ 2020 Oracle and/or its affiliates.
28 /
96
Copyright @ 2020 Oracle and/or its affiliates.
29 /
96
Some more examples
Copyright @ 2020 Oracle and/or its affiliates.
30 /
96
Let's add a selection criteria:
Copyright @ 2020 Oracle and/or its affiliates.
31 /
96
Simpler Syntax than other Document Store
Copyright @ 2020 Oracle and/or its affiliates.
32 /
96
Simpler Syntax than other Document Store
Copyright @ 2020 Oracle and/or its affiliates.
33 /
96
NoSQL + SQL =
MySQL
Copyright @ 2020 Oracle and/or its affiliates.
34 /
96
SQL
Copyright @ 2020 Oracle and/or its affiliates.
35 /
96
Credits: @MarkusWinand - @ModernSQL
SQL: RECURSION / CTEs
Copyright @ 2020 Oracle and/or its affiliates.
36 /
96
Credits: @MarkusWinand - @ModernSQL
SQL: LATERAL
Copyright @ 2020 Oracle and/or its affiliates.
37 /
96
Credits: @MarkusWinand - @ModernSQL
SQL: Analytical / Window Functions
Copyright @ 2020 Oracle and/or its affiliates.
38 /
96
Credits: @MarkusWinand - @ModernSQL
SQL: Analytical / Window Functions
Copyright @ 2020 Oracle and/or its affiliates.
39 /
96
Credits: @MarkusWinand - @ModernSQL
SQL: JSON_TABLE
Copyright @ 2020 Oracle and/or its affiliates.
40 /
96
Credits: @MarkusWinand - @ModernSQL
SQL: JSON_TABLE
Copyright @ 2020 Oracle and/or its affiliates.
41 /
96
List the best restaurant of each type of
food and show the top 10, with the best
one first !
Copyright @ 2020 Oracle and/or its affiliates.
42 /
96
And all together !
Copyright @ 2020 Oracle and/or its affiliates.
43 /
96
And all together !
Copyright @ 2020 Oracle and/or its affiliates.
44 /
96
More Validation
Copyright @ 2020 Oracle and/or its affiliates.
45 /
96
CHECK CONSTRAINTS
Copyright @ 2020 Oracle and/or its affiliates.
46 /
96
JSON SCHEMA VALIDATION
Copyright @ 2020 Oracle and/or its affiliates.
47 /
96
JSON SCHEMA VALIDATION
Copyright @ 2020 Oracle and/or its affiliates.
48 /
96
JSON SCHEMA VALIDATION
And the best of both worlds:
Copyright @ 2020 Oracle and/or its affiliates.
49 /
96
JSON SCHEMA VALIDATION
And the best of both worlds:
Copyright @ 2020 Oracle and/or its affiliates.
50 /
96
JSON SCHEMA VALIDATION
And the best of both worlds:
Copyright @ 2020 Oracle and/or its affiliates.
51 /
96
JSON Array
Indexes
Copyright @ 2020 Oracle and/or its affiliates.
52 /
96
Index of a JSON array
A functional index over a JSON
expression
The expression evaluates to an array
Several index entries per row
One index entry per array element
General mechanism, currently used
for JSON arrays
Used to speed up array lookups
JSON_CONTAINS(...)
JSON_OVERLAPS(...)
MEMBER OF (...)
JSON Array Indexes
Copyright @ 2020 Oracle and/or its affiliates.
53 /
96
JSON Array Indexes
Copyright @ 2020 Oracle and/or its affiliates.
54 /
96
JSON Array Indexes
Copyright @ 2020 Oracle and/or its affiliates.
55 /
96
JSON Array Indexes
Copyright @ 2020 Oracle and/or its affiliates.
56 /
96
we want more !
Extending MySQL Shell
Copyright @ 2020 Oracle and/or its affiliates.
57 /
96
MySQL Shell and Javascript
In JS mode, it's also possible to load some pure Javascript modules installed in sys.path:
Copyright @ 2020 Oracle and/or its affiliates.
58 /
96
MySQL Shell and Javascript (2)
The module has to be pure JS (not node.JS) modules:
Copyright @ 2020 Oracle and/or its affiliates.
59 /
96
MySQL Shell and Javascript (3)
Then your module can be loaded and used like this:
Copyright @ 2020 Oracle and/or its affiliates.
60 /
96
MySQL Shell and Python
When using the python mode in the Shell, it's even possible to use system modules (local).
Copyright @ 2020 Oracle and/or its affiliates.
61 /
96
MySQL Shell and Python (2)
Of course this can be any type of modules:
Copyright @ 2020 Oracle and/or its affiliates.
62 /
96
MySQL Shell and Python (2)
Of course this can be any type of modules:
Copyright @ 2020 Oracle and/or its affiliates.
63 /
96
Extending MySQL Shell
Since 8.0.17, you have 3 di erent ways to extend the MySQL Shell:
using the new Reporting Framework (>= 8.0.16)
create your own modules to extend MySQL Shell (obsolete)
create your own plugins that will be completely integrated in all supported interpreters
(>= 8.0.17)
8.0
Copyright @ 2020 Oracle and/or its affiliates.
64 /
96
MySQL Shell User-Defined Reports
You can create reports that are called once on demand (show) or constantly refreshed
(watch).
Example for checking the LOCKS:
Copyright @ 2020 Oracle and/or its affiliates.
65 /
96
MySQL Shell User-Defined Reports (2)
This is a Python le (locks_info.py) installed in ~/.mysqlsh/init.d:
It contains a de nition and a registration:
def locks_info(session):
query = session.sql("select ...")
...
return {'report': report}
shell.register_report(
'locks_info',
'list',
locks_info,
{
'brief': 'Shows Locks.',
'details': ['You need the SELECT privilege on sys.session view and the ..'],
'argc': '0'
}
)
Copyright @ 2020 Oracle and/or its affiliates.
66 /
96
MySQL Shell User-Defined Reports (3)
User-De ned Reports can be called from any MySQL Shell mode, even SQL:
Copyright @ 2020 Oracle and/or its affiliates.
67 /
96
MySQL Shell User-Defined Reports (4)
More info:
h ps://lefred.be/content/using-the-new-mysql-shell-reporting-framework-to-
monitor-innodb-cluster/
h ps://lefred.be/content/mysql-innodb-cluster-recovery-process-monitoring-with-
the-mysql-shell-reporting-framework/
Copyright @ 2020 Oracle and/or its affiliates.
68 /
96
MySQL Shell User-Defined Reports (4)
Sources of Examples:
h ps://github.com/lefred/mysql-shell-udr
Pull Requests welcome !
Copyright @ 2020 Oracle and/or its affiliates.
69 /
96
Why should I extend the MySQL Shell with
plugins?
For calling some long statements or group of operations or sometimes to replace a
missing functionality.
Copyright @ 2020 Oracle and/or its affiliates.
70 /
96
Why should I extend the MySQL Shell with
plugins?
For calling some long statements or group of operations or sometimes to replace a
missing functionality.
Recently, somebody pointed out that since the new DD it was not anymore possible to
delete all routines for a speci c schema.
Copyright @ 2020 Oracle and/or its affiliates.
71 /
96
Why should I extend the MySQL Shell with
plugins?
For calling some long statements or group of operations or sometimes to replace a
missing functionality.
Recently, somebody pointed out that since the new DD it was not anymore possible to
delete all routines for a speci c schema.
Jesper explained how the MySQL Shell could help here see
h ps://mysql.wisborg.dk/2018/12/02/mysql-8-drop-several-stored-events-procedures-
or-functions/
Copyright @ 2020 Oracle and/or its affiliates.
72 /
96
Using a plugin within MySQL Shell
Plugins are available from the ext global object:
Copyright @ 2020 Oracle and/or its affiliates.
73 /
96
Using a plugin within MySQL Shell (2)
Help is automatically available:
Copyright @ 2020 Oracle and/or its affiliates.
74 /
96
Using a plugin within MySQL Shell (3)
Plugins are available from JS and Python, regardless of the language in which they are
wri en:
Copyright @ 2020 Oracle and/or its affiliates.
75 /
96
Using a plugin wi thin MySQL Shell (4)
The help goes from the plugin to its methods:
Copyright @ 2020 Oracle and/or its affiliates.
76 /
96
Using a plugin within MySQL Shell (5)
And nally the plugin in action:
Copyright @ 2020 Oracle and/or its affiliates.
77 /
96
Using a plugin within MySQL Shell (5)
And nally the plugin in action:
Copyright @ 2020 Oracle and/or its affiliates.
78 /
96
How to use MySQL Shell Plugins ?
Plugins must be installed inside ~/.mysqlsh/plugins/ext directory.
Several existing plugins can be found at h ps://github.com/lefred/mysqlshell-plugins
Plugins are split in di erent categories:
check innodb_cluster router
collations maintenance schema
con guration performance security
demo proxysql support
innodb ...
Copyright @ 2020 Oracle and/or its affiliates.
79 /
96
Overview of some plugins
Extending MySQL Shell with Plugins
Copyright @ 2020 Oracle and/or its affiliates.
80 /
96
MySQL Shell: Security
Retrieving the expiration period of passwords:
Copyright @ 2020 Oracle and/or its affiliates.
81 /
96
MySQL Shell: InnoDB
Which tables are potentially fragmented:
Copyright @ 2020 Oracle and/or its affiliates.
82 /
96
MySQL Shell: InnoDB (2)
And it can be improved using table space on disk size:
Copyright @ 2020 Oracle and/or its affiliates.
83 /
96
MySQL Shell: Schema
We already saw how we added methods to show and delete procedures. But recently
somebody complained about the complexity of knowing what are the default values of
columns when expressions are used (h ps://forums.mysql.com/read.php?
101,670682,670682):
Copyright @ 2020 Oracle and/or its affiliates.
84 /
96
MySQL Shell: Schema (2)
In MySQL 8.0, 0000-00-00 is not a valid value for a date eld anymore. We can check for
such dates in our dataset:
More Info: h ps://lefred.be/content/mysql-8-0-and-wrong-dates/
Copyright @ 2020 Oracle and/or its affiliates.
85 /
96
MySQL Shell: Maintenance
When using MySQL X Protocol, it's not allowed to shutdown MySQL. This plugin resolves
this limitation:
Copyright @ 2020 Oracle and/or its affiliates.
86 /
96
MySQL Shell: Collations
When upgrading, the collation might be problematic for unique values. This plugin from
Bernt Marius Johnsen shows the non-unique values for a speci c collation:
Copyright @ 2020 Oracle and/or its affiliates.
87 /
96
Outside MySQL
It's also possible to interact with external tools
Copyright @ 2020 Oracle and/or its affiliates.
88 /
96
Monitoring MySQL Router
With the MySQL Shell and MySQL Router's REST API, it's even possible to create a plugin
to monitor the Router:
Copyright @ 2020 Oracle and/or its affiliates.
89 /
96
Monitoring MySQL Router (2)
Copyright @ 2020 Oracle and/or its affiliates.
90 /
96
MySQL Shell and ProxySQL
It's also possible to integrate 3rd party projects directly in MySQL Shell:
Copyright @ 2020 Oracle and/or its affiliates.
91 /
96
MySQL Shell and ProxySQL
Copyright @ 2020 Oracle and/or its affiliates.
92 /
96
And much more on
https://github.com/lefred/mysqlshell-plugins
Copyright @ 2020 Oracle and/or its affiliates.
93 /
96
Thank you !
Copyright @ 2020 Oracle and/or its affiliates.
94 /
96
Upgrade to MySQL 8.0
It's time to upgrade to
MySQL 8.0, the fastest MySQL
adoption release ever !
Copyright @ 2020 Oracle and/or its affiliates.
95 /
96
Upgrade to MySQL 8.0
It's time to upgrade to
MySQL 8.0, the fastest MySQL
adoption release ever !
Copyright @ 2020 Oracle and/or its affiliates.
96 /
96

More Related Content

What's hot (20)

PDF
MySQL Shell: the best DBA tool !
Frederic Descamps
 
PDF
MySQL Group Replication: Handling Network Glitches - Best Practices
Frederic Descamps
 
PDF
Python and MySQL 8.0 Document Store
Frederic Descamps
 
PDF
State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20
Frederic Descamps
 
PDF
MySQL Shell - the best DBA tool ?
Frederic Descamps
 
PDF
OpenExpo Virtual Experience 2020: MySQL 8.0 Document Store - Discovery of a n...
Frederic Descamps
 
PDF
MySQL 8.0 : High Availability Solution for Everybody
Frederic Descamps
 
PDF
preFOSDEM MySQL Day - Best Practices to Upgrade to MySQL 8.0
Frederic Descamps
 
PDF
the State of the Dolphin - October 2020
Frederic Descamps
 
PDF
Looking Inside the MySQL 8.0 Document Store
Frederic Descamps
 
PDF
MySQL Day Virtual: Best Practices Tips - Upgrading to MySQL 8.0
Frederic Descamps
 
PDF
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDS
Frederic Descamps
 
PDF
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
Frederic Descamps
 
PDF
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
Frederic Descamps
 
PDF
MySQL Database Service Webinar: Upgrading from on-premise MySQL to MDS
Frederic Descamps
 
PDF
Deploying Magento on OCI with MDS
Frederic Descamps
 
PDF
Hash join in MySQL 8
Erik Frøseth
 
PDF
MySQL InnoDB Cluster and Group Replication in a Nutshell
Frederic Descamps
 
PDF
Les nouveautés de MySQL 8.0
Frederic Descamps
 
PDF
MySQL : State of the Dolphin May 2019
Frederic Descamps
 
MySQL Shell: the best DBA tool !
Frederic Descamps
 
MySQL Group Replication: Handling Network Glitches - Best Practices
Frederic Descamps
 
Python and MySQL 8.0 Document Store
Frederic Descamps
 
State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20
Frederic Descamps
 
MySQL Shell - the best DBA tool ?
Frederic Descamps
 
OpenExpo Virtual Experience 2020: MySQL 8.0 Document Store - Discovery of a n...
Frederic Descamps
 
MySQL 8.0 : High Availability Solution for Everybody
Frederic Descamps
 
preFOSDEM MySQL Day - Best Practices to Upgrade to MySQL 8.0
Frederic Descamps
 
the State of the Dolphin - October 2020
Frederic Descamps
 
Looking Inside the MySQL 8.0 Document Store
Frederic Descamps
 
MySQL Day Virtual: Best Practices Tips - Upgrading to MySQL 8.0
Frederic Descamps
 
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDS
Frederic Descamps
 
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
Frederic Descamps
 
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
Frederic Descamps
 
MySQL Database Service Webinar: Upgrading from on-premise MySQL to MDS
Frederic Descamps
 
Deploying Magento on OCI with MDS
Frederic Descamps
 
Hash join in MySQL 8
Erik Frøseth
 
MySQL InnoDB Cluster and Group Replication in a Nutshell
Frederic Descamps
 
Les nouveautés de MySQL 8.0
Frederic Descamps
 
MySQL : State of the Dolphin May 2019
Frederic Descamps
 

Similar to UAE MySQL Users Group Meet-up : MySQL Shell Document Store & more... (20)

PDF
MySQL Shell for DBAs
Frederic Descamps
 
PDF
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
Cloud Native Day Tel Aviv
 
PDF
MySQL Shell - The Best MySQL DBA Tool
Miguel Araújo
 
PDF
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
Frederic Descamps
 
PPTX
2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...
Geir Høydalsvik
 
PDF
MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?
Olivier DASINI
 
PDF
MySQL Shell: The DevOps Tool for MySQL
Miguel Araújo
 
PPTX
Making MySQL Agile-ish
Dave Stokes
 
PDF
MySQL Document Store
Mario Beck
 
PDF
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
Olivier DASINI
 
PDF
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
Dave Stokes
 
PDF
MySQL 8: Ready for Prime Time
Arnab Ray
 
PDF
20180420 hk-the powerofmysql8
Ivan Ma
 
PPTX
MySQL 8.0 Featured for Developers
Dave Stokes
 
PDF
What's New in MySQL 8.0 @ HKOSC 2017
Ivan Ma
 
PDF
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
Dave Stokes
 
PDF
MySQL New Features -- Sunshine PHP 2020 Presentation
Dave Stokes
 
PDF
MySQL 8.0 Introduction to NoSQL + SQL
Manuel Contreras
 
PPTX
MySQL Without the SQL -- Oh My! Longhorn PHP Conference
Dave Stokes
 
PPTX
MySQL Quick Dive
Sudipta Kumar Sahoo
 
MySQL Shell for DBAs
Frederic Descamps
 
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
Cloud Native Day Tel Aviv
 
MySQL Shell - The Best MySQL DBA Tool
Miguel Araújo
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
Frederic Descamps
 
2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...
Geir Høydalsvik
 
MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?
Olivier DASINI
 
MySQL Shell: The DevOps Tool for MySQL
Miguel Araújo
 
Making MySQL Agile-ish
Dave Stokes
 
MySQL Document Store
Mario Beck
 
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
Olivier DASINI
 
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
Dave Stokes
 
MySQL 8: Ready for Prime Time
Arnab Ray
 
20180420 hk-the powerofmysql8
Ivan Ma
 
MySQL 8.0 Featured for Developers
Dave Stokes
 
What's New in MySQL 8.0 @ HKOSC 2017
Ivan Ma
 
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
Dave Stokes
 
MySQL New Features -- Sunshine PHP 2020 Presentation
Dave Stokes
 
MySQL 8.0 Introduction to NoSQL + SQL
Manuel Contreras
 
MySQL Without the SQL -- Oh My! Longhorn PHP Conference
Dave Stokes
 
MySQL Quick Dive
Sudipta Kumar Sahoo
 
Ad

More from Frederic Descamps (19)

PDF
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
Frederic Descamps
 
PDF
RivieraJUG - MySQL Indexes and Histograms
Frederic Descamps
 
PDF
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
Frederic Descamps
 
PDF
MySQL User Group NL - MySQL 8
Frederic Descamps
 
PDF
State of the Dolphin - May 2022
Frederic Descamps
 
PDF
Percona Live 2022 - MySQL Shell for Visual Studio Code
Frederic Descamps
 
PDF
Percona Live 2022 - The Evolution of a MySQL Database System
Frederic Descamps
 
PDF
Percona Live 2022 - MySQL Architectures
Frederic Descamps
 
PDF
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
Frederic Descamps
 
PDF
Open Source 101 2022 - MySQL Indexes and Histograms
Frederic Descamps
 
PDF
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
Frederic Descamps
 
PDF
Confoo 2022 - le cycle d'une instance MySQL
Frederic Descamps
 
PDF
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
Frederic Descamps
 
PDF
Les nouveautés de MySQL 8.0
Frederic Descamps
 
PDF
State of The Dolphin - May 2021
Frederic Descamps
 
PDF
MySQL Router REST API
Frederic Descamps
 
PDF
From single MySQL instance to High Availability: the journey to MySQL InnoDB ...
Frederic Descamps
 
PDF
MySQL Database Service Webinar: Installing Drupal in oci with mds
Frederic Descamps
 
PDF
MySQL 8.0 Document Store - Discovery of a New World
Frederic Descamps
 
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
Frederic Descamps
 
RivieraJUG - MySQL Indexes and Histograms
Frederic Descamps
 
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
Frederic Descamps
 
MySQL User Group NL - MySQL 8
Frederic Descamps
 
State of the Dolphin - May 2022
Frederic Descamps
 
Percona Live 2022 - MySQL Shell for Visual Studio Code
Frederic Descamps
 
Percona Live 2022 - The Evolution of a MySQL Database System
Frederic Descamps
 
Percona Live 2022 - MySQL Architectures
Frederic Descamps
 
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
Frederic Descamps
 
Open Source 101 2022 - MySQL Indexes and Histograms
Frederic Descamps
 
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
Frederic Descamps
 
Confoo 2022 - le cycle d'une instance MySQL
Frederic Descamps
 
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
Frederic Descamps
 
Les nouveautés de MySQL 8.0
Frederic Descamps
 
State of The Dolphin - May 2021
Frederic Descamps
 
MySQL Router REST API
Frederic Descamps
 
From single MySQL instance to High Availability: the journey to MySQL InnoDB ...
Frederic Descamps
 
MySQL Database Service Webinar: Installing Drupal in oci with mds
Frederic Descamps
 
MySQL 8.0 Document Store - Discovery of a New World
Frederic Descamps
 
Ad

Recently uploaded (20)

PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
DOCX
Import Data Form Excel to Tally Services
Tally xperts
 
PPT
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Import Data Form Excel to Tally Services
Tally xperts
 
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
Human Resources Information System (HRIS)
Amity University, Patna
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 

UAE MySQL Users Group Meet-up : MySQL Shell Document Store & more...

  • 2. Frédéric Descamps Community Manager MySQL MySQL Shell: Document Store & More MySQL 8 is Great ! 2 / 96
  • 3.   Safe Harbor The following is intended to outline our general product direction. It is intended for information purpose only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied up in making purchasing decisions. The development, release, timing and pricing of any features or functionality described for Oracle´s product may change and remains at the sole discretion of Oracle Corporation. Statement in this presentation relating to Oracle´s future plans, expectations, beliefs, intentions and ptospects are "forward-looking statements" and are subject to material risks and uncertainties. A detailed discussion of these factors and other risks that a ect our business is contained in Oracle´s Securities and Exchange Commission (SEC) lings, including our most recent reports on Form 10-K and Form 10-Q under the heading "Risk Factors". These lings are available on the SEC´s website or on Oracle´s website at h p://www.oracle.com/investor. All information in this presentation is current as of September 2019 and Oracle undertakes no duty to update any statement in light of new information or future events. Copyright @ 2020 Oracle and/or its affiliates. 3 / 96
  • 4. Who am I ? Copyright @ 2020 Oracle and/or its affiliates. 4 / 96
  • 5. Frédéric Descamps @lefred MySQL Evangelist Managing MySQL since 3.23 devops believer living in Belgium 🇧🇪 h ps://lefred.be Copyright @ 2020 Oracle and/or its affiliates. 5 / 96
  • 6. MySQL Shell The MySQL Shell is an interactive Javascript, Python, or SQL interface supporting development and administration for the MySQL Server and is a component of the MySQL Server. You can use the MySQL Shell to perform data queries and updates as well as various administration operations. Copyright @ 2020 Oracle and/or its affiliates. 6 / 96
  • 7. MySQL Shell (2) The MySQL Shell provides: Copyright @ 2020 Oracle and/or its affiliates. 7 / 96
  • 8. MySQL Shell (2) The MySQL Shell provides: Both Interactive and Batch operations Copyright @ 2020 Oracle and/or its affiliates. 8 / 96
  • 9. MySQL Shell (2) The MySQL Shell provides: Both Interactive and Batch operations Document and Relational Models Copyright @ 2020 Oracle and/or its affiliates. 9 / 96
  • 10. MySQL Shell (2) The MySQL Shell provides: Both Interactive and Batch operations Document and Relational Models CRUD Document and Relational APIs via scripting Copyright @ 2020 Oracle and/or its affiliates. 10 / 96
  • 11. MySQL Shell (2) The MySQL Shell provides: Both Interactive and Batch operations Document and Relational Models CRUD Document and Relational APIs via scripting Traditional Table, JSON, Tab Separated output results formats Copyright @ 2020 Oracle and/or its affiliates. 11 / 96
  • 12. MySQL Shell (2) The MySQL Shell provides: Both Interactive and Batch operations Document and Relational Models CRUD Document and Relational APIs via scripting Traditional Table, JSON, Tab Separated output results formats MySQL Standard and X Protocols Copyright @ 2020 Oracle and/or its affiliates. 12 / 96
  • 13. MySQL Shell (2) The MySQL Shell provides: Both Interactive and Batch operations Document and Relational Models CRUD Document and Relational APIs via scripting Traditional Table, JSON, Tab Separated output results formats MySQL Standard and X Protocols and more... Copyright @ 2020 Oracle and/or its affiliates. 13 / 96
  • 14. MySQL Shell Overview PY JS SQL > MySQL 8.0 Upgrade Checker Auto Completion & Command History Output Formats (table, json, tabs) Prompt Themes Batch Execution 5.7 8.0 JS Document Store X dev API SQL CLI InnoDB Cluster importJSON JSJS parallel importTABLE data Copyright @ 2020 Oracle and/or its affiliates. 14 / 96
  • 15. setup your environment Starting with MySQL Shell Copyright @ 2020 Oracle and/or its affiliates. 15 / 96
  • 16. Install MySQL Shell the package's name to install is mysql-shell you always need to use the latest available even with a lower MySQL Server version latest version is 8.0.19, use it even with MySQL 5.7.x Shell Copyright @ 2020 Oracle and/or its affiliates. 16 / 96
  • 17. Start a beautiful Shell The default prompts is basic, we provide several di erent prompt examples. # cp /usr/share/mysqlsh/prompt/prompt_256pl+aw.json ~/.mysqlsh/prompt.json Then start the mysqlsh: Copyright @ 2020 Oracle and/or its affiliates. 17 / 96
  • 18. Start a beautiful Shell The default prompts is basic, we provide several di erent prompt examples. # cp /usr/share/mysqlsh/prompt/prompt_256pl+aw.json ~/.mysqlsh/prompt.json Then start the mysqlsh: Copyright @ 2020 Oracle and/or its affiliates. 18 / 96
  • 19. Some configuration tips These are some se ings I usually use: mysql-js> shell.options.setPersist('history.autoSave', 1) mysql-js> shell.options.setPersist('history.maxSize', 5000) You can switch to all 3 di erent modes using: py for Python js for Javascript sql for SQL If you have a preferred mode, you can specify it like this: mysql-js> shell.options.setPersist('defaultMode', 'sql') Copyright @ 2020 Oracle and/or its affiliates. 19 / 96
  • 20. Util The MySQL Shell comes with a global object called util. This object is used to perform some dedicated DBA tasks like: Checking if the server's con guration and schema design is compatible with next MySQL version (checkForServerUpdrade()) Importing JSON documents, like exports from MondoDB (importJSON()) Importing table dumps in parallel (importTable()) Con guring OCI pro le (con gureOCI()) Copyright @ 2020 Oracle and/or its affiliates. 20 / 96
  • 21. Admin API The Admin API is used to con gure MySQL instances to be part of a MySQL InnoDB Cluster or a MySQL InnoDB ReplicaSet - NEW in 8.0.19. It also creates and manage clusters. More Info: h ps://lefred.be/content/mysql-innodb-cluster-from-scratch-even-more- easy-since-8-0-17/ Copyright @ 2020 Oracle and/or its affiliates. 21 / 96
  • 22. NoSQL Copyright @ 2020 Oracle and/or its affiliates. 22 / 96
  • 23. * CREATE * READ * UPDATE * DELETE col->add({title: 'MySQL is Great', author: 'lefred' }) col-> nd() collection.modify('author = "lefred"').set('author', 'kenny') col.remove('author = "lefred"') MySQL supports JSON & CRUD operations Copyright @ 2020 Oracle and/or its affiliates. 23 / 96
  • 24. * CREATE * READ * UPDATE * DELETE col->add({title: 'MySQL is Great', author: 'lefred' }) col-> nd() collection.modify('author = "lefred"').set('author', 'kenny') col.remove('author = "lefred"') MySQL supports JSON & CRUD operations It's possible to use MySQL without a single line of SQL ! Copyright @ 2020 Oracle and/or its affiliates. 24 / 96
  • 25. Migration from MongoDB to MySQL DS For this example, I will use the well known restaurants collection: Copyright @ 2020 Oracle and/or its affiliates. 25 / 96
  • 26. Migration from MongoDB to MySQL DS For this example, I will use the well known restaurants collection: Copyright @ 2020 Oracle and/or its affiliates. 26 / 96
  • 27. Let's make a query Copyright @ 2020 Oracle and/or its affiliates. 27 / 96
  • 28. Let's make a query That's too much records to show in here... let's limit it Copyright @ 2020 Oracle and/or its affiliates. 28 / 96
  • 29. Copyright @ 2020 Oracle and/or its affiliates. 29 / 96
  • 30. Some more examples Copyright @ 2020 Oracle and/or its affiliates. 30 / 96
  • 31. Let's add a selection criteria: Copyright @ 2020 Oracle and/or its affiliates. 31 / 96
  • 32. Simpler Syntax than other Document Store Copyright @ 2020 Oracle and/or its affiliates. 32 / 96
  • 33. Simpler Syntax than other Document Store Copyright @ 2020 Oracle and/or its affiliates. 33 / 96
  • 34. NoSQL + SQL = MySQL Copyright @ 2020 Oracle and/or its affiliates. 34 / 96
  • 35. SQL Copyright @ 2020 Oracle and/or its affiliates. 35 / 96
  • 36. Credits: @MarkusWinand - @ModernSQL SQL: RECURSION / CTEs Copyright @ 2020 Oracle and/or its affiliates. 36 / 96
  • 37. Credits: @MarkusWinand - @ModernSQL SQL: LATERAL Copyright @ 2020 Oracle and/or its affiliates. 37 / 96
  • 38. Credits: @MarkusWinand - @ModernSQL SQL: Analytical / Window Functions Copyright @ 2020 Oracle and/or its affiliates. 38 / 96
  • 39. Credits: @MarkusWinand - @ModernSQL SQL: Analytical / Window Functions Copyright @ 2020 Oracle and/or its affiliates. 39 / 96
  • 40. Credits: @MarkusWinand - @ModernSQL SQL: JSON_TABLE Copyright @ 2020 Oracle and/or its affiliates. 40 / 96
  • 41. Credits: @MarkusWinand - @ModernSQL SQL: JSON_TABLE Copyright @ 2020 Oracle and/or its affiliates. 41 / 96
  • 42. List the best restaurant of each type of food and show the top 10, with the best one first ! Copyright @ 2020 Oracle and/or its affiliates. 42 / 96
  • 43. And all together ! Copyright @ 2020 Oracle and/or its affiliates. 43 / 96
  • 44. And all together ! Copyright @ 2020 Oracle and/or its affiliates. 44 / 96
  • 45. More Validation Copyright @ 2020 Oracle and/or its affiliates. 45 / 96
  • 46. CHECK CONSTRAINTS Copyright @ 2020 Oracle and/or its affiliates. 46 / 96
  • 47. JSON SCHEMA VALIDATION Copyright @ 2020 Oracle and/or its affiliates. 47 / 96
  • 48. JSON SCHEMA VALIDATION Copyright @ 2020 Oracle and/or its affiliates. 48 / 96
  • 49. JSON SCHEMA VALIDATION And the best of both worlds: Copyright @ 2020 Oracle and/or its affiliates. 49 / 96
  • 50. JSON SCHEMA VALIDATION And the best of both worlds: Copyright @ 2020 Oracle and/or its affiliates. 50 / 96
  • 51. JSON SCHEMA VALIDATION And the best of both worlds: Copyright @ 2020 Oracle and/or its affiliates. 51 / 96
  • 52. JSON Array Indexes Copyright @ 2020 Oracle and/or its affiliates. 52 / 96
  • 53. Index of a JSON array A functional index over a JSON expression The expression evaluates to an array Several index entries per row One index entry per array element General mechanism, currently used for JSON arrays Used to speed up array lookups JSON_CONTAINS(...) JSON_OVERLAPS(...) MEMBER OF (...) JSON Array Indexes Copyright @ 2020 Oracle and/or its affiliates. 53 / 96
  • 54. JSON Array Indexes Copyright @ 2020 Oracle and/or its affiliates. 54 / 96
  • 55. JSON Array Indexes Copyright @ 2020 Oracle and/or its affiliates. 55 / 96
  • 56. JSON Array Indexes Copyright @ 2020 Oracle and/or its affiliates. 56 / 96
  • 57. we want more ! Extending MySQL Shell Copyright @ 2020 Oracle and/or its affiliates. 57 / 96
  • 58. MySQL Shell and Javascript In JS mode, it's also possible to load some pure Javascript modules installed in sys.path: Copyright @ 2020 Oracle and/or its affiliates. 58 / 96
  • 59. MySQL Shell and Javascript (2) The module has to be pure JS (not node.JS) modules: Copyright @ 2020 Oracle and/or its affiliates. 59 / 96
  • 60. MySQL Shell and Javascript (3) Then your module can be loaded and used like this: Copyright @ 2020 Oracle and/or its affiliates. 60 / 96
  • 61. MySQL Shell and Python When using the python mode in the Shell, it's even possible to use system modules (local). Copyright @ 2020 Oracle and/or its affiliates. 61 / 96
  • 62. MySQL Shell and Python (2) Of course this can be any type of modules: Copyright @ 2020 Oracle and/or its affiliates. 62 / 96
  • 63. MySQL Shell and Python (2) Of course this can be any type of modules: Copyright @ 2020 Oracle and/or its affiliates. 63 / 96
  • 64. Extending MySQL Shell Since 8.0.17, you have 3 di erent ways to extend the MySQL Shell: using the new Reporting Framework (>= 8.0.16) create your own modules to extend MySQL Shell (obsolete) create your own plugins that will be completely integrated in all supported interpreters (>= 8.0.17) 8.0 Copyright @ 2020 Oracle and/or its affiliates. 64 / 96
  • 65. MySQL Shell User-Defined Reports You can create reports that are called once on demand (show) or constantly refreshed (watch). Example for checking the LOCKS: Copyright @ 2020 Oracle and/or its affiliates. 65 / 96
  • 66. MySQL Shell User-Defined Reports (2) This is a Python le (locks_info.py) installed in ~/.mysqlsh/init.d: It contains a de nition and a registration: def locks_info(session): query = session.sql("select ...") ... return {'report': report} shell.register_report( 'locks_info', 'list', locks_info, { 'brief': 'Shows Locks.', 'details': ['You need the SELECT privilege on sys.session view and the ..'], 'argc': '0' } ) Copyright @ 2020 Oracle and/or its affiliates. 66 / 96
  • 67. MySQL Shell User-Defined Reports (3) User-De ned Reports can be called from any MySQL Shell mode, even SQL: Copyright @ 2020 Oracle and/or its affiliates. 67 / 96
  • 68. MySQL Shell User-Defined Reports (4) More info: h ps://lefred.be/content/using-the-new-mysql-shell-reporting-framework-to- monitor-innodb-cluster/ h ps://lefred.be/content/mysql-innodb-cluster-recovery-process-monitoring-with- the-mysql-shell-reporting-framework/ Copyright @ 2020 Oracle and/or its affiliates. 68 / 96
  • 69. MySQL Shell User-Defined Reports (4) Sources of Examples: h ps://github.com/lefred/mysql-shell-udr Pull Requests welcome ! Copyright @ 2020 Oracle and/or its affiliates. 69 / 96
  • 70. Why should I extend the MySQL Shell with plugins? For calling some long statements or group of operations or sometimes to replace a missing functionality. Copyright @ 2020 Oracle and/or its affiliates. 70 / 96
  • 71. Why should I extend the MySQL Shell with plugins? For calling some long statements or group of operations or sometimes to replace a missing functionality. Recently, somebody pointed out that since the new DD it was not anymore possible to delete all routines for a speci c schema. Copyright @ 2020 Oracle and/or its affiliates. 71 / 96
  • 72. Why should I extend the MySQL Shell with plugins? For calling some long statements or group of operations or sometimes to replace a missing functionality. Recently, somebody pointed out that since the new DD it was not anymore possible to delete all routines for a speci c schema. Jesper explained how the MySQL Shell could help here see h ps://mysql.wisborg.dk/2018/12/02/mysql-8-drop-several-stored-events-procedures- or-functions/ Copyright @ 2020 Oracle and/or its affiliates. 72 / 96
  • 73. Using a plugin within MySQL Shell Plugins are available from the ext global object: Copyright @ 2020 Oracle and/or its affiliates. 73 / 96
  • 74. Using a plugin within MySQL Shell (2) Help is automatically available: Copyright @ 2020 Oracle and/or its affiliates. 74 / 96
  • 75. Using a plugin within MySQL Shell (3) Plugins are available from JS and Python, regardless of the language in which they are wri en: Copyright @ 2020 Oracle and/or its affiliates. 75 / 96
  • 76. Using a plugin wi thin MySQL Shell (4) The help goes from the plugin to its methods: Copyright @ 2020 Oracle and/or its affiliates. 76 / 96
  • 77. Using a plugin within MySQL Shell (5) And nally the plugin in action: Copyright @ 2020 Oracle and/or its affiliates. 77 / 96
  • 78. Using a plugin within MySQL Shell (5) And nally the plugin in action: Copyright @ 2020 Oracle and/or its affiliates. 78 / 96
  • 79. How to use MySQL Shell Plugins ? Plugins must be installed inside ~/.mysqlsh/plugins/ext directory. Several existing plugins can be found at h ps://github.com/lefred/mysqlshell-plugins Plugins are split in di erent categories: check innodb_cluster router collations maintenance schema con guration performance security demo proxysql support innodb ... Copyright @ 2020 Oracle and/or its affiliates. 79 / 96
  • 80. Overview of some plugins Extending MySQL Shell with Plugins Copyright @ 2020 Oracle and/or its affiliates. 80 / 96
  • 81. MySQL Shell: Security Retrieving the expiration period of passwords: Copyright @ 2020 Oracle and/or its affiliates. 81 / 96
  • 82. MySQL Shell: InnoDB Which tables are potentially fragmented: Copyright @ 2020 Oracle and/or its affiliates. 82 / 96
  • 83. MySQL Shell: InnoDB (2) And it can be improved using table space on disk size: Copyright @ 2020 Oracle and/or its affiliates. 83 / 96
  • 84. MySQL Shell: Schema We already saw how we added methods to show and delete procedures. But recently somebody complained about the complexity of knowing what are the default values of columns when expressions are used (h ps://forums.mysql.com/read.php? 101,670682,670682): Copyright @ 2020 Oracle and/or its affiliates. 84 / 96
  • 85. MySQL Shell: Schema (2) In MySQL 8.0, 0000-00-00 is not a valid value for a date eld anymore. We can check for such dates in our dataset: More Info: h ps://lefred.be/content/mysql-8-0-and-wrong-dates/ Copyright @ 2020 Oracle and/or its affiliates. 85 / 96
  • 86. MySQL Shell: Maintenance When using MySQL X Protocol, it's not allowed to shutdown MySQL. This plugin resolves this limitation: Copyright @ 2020 Oracle and/or its affiliates. 86 / 96
  • 87. MySQL Shell: Collations When upgrading, the collation might be problematic for unique values. This plugin from Bernt Marius Johnsen shows the non-unique values for a speci c collation: Copyright @ 2020 Oracle and/or its affiliates. 87 / 96
  • 88. Outside MySQL It's also possible to interact with external tools Copyright @ 2020 Oracle and/or its affiliates. 88 / 96
  • 89. Monitoring MySQL Router With the MySQL Shell and MySQL Router's REST API, it's even possible to create a plugin to monitor the Router: Copyright @ 2020 Oracle and/or its affiliates. 89 / 96
  • 90. Monitoring MySQL Router (2) Copyright @ 2020 Oracle and/or its affiliates. 90 / 96
  • 91. MySQL Shell and ProxySQL It's also possible to integrate 3rd party projects directly in MySQL Shell: Copyright @ 2020 Oracle and/or its affiliates. 91 / 96
  • 92. MySQL Shell and ProxySQL Copyright @ 2020 Oracle and/or its affiliates. 92 / 96
  • 93. And much more on https://github.com/lefred/mysqlshell-plugins Copyright @ 2020 Oracle and/or its affiliates. 93 / 96
  • 94. Thank you ! Copyright @ 2020 Oracle and/or its affiliates. 94 / 96
  • 95. Upgrade to MySQL 8.0 It's time to upgrade to MySQL 8.0, the fastest MySQL adoption release ever ! Copyright @ 2020 Oracle and/or its affiliates. 95 / 96
  • 96. Upgrade to MySQL 8.0 It's time to upgrade to MySQL 8.0, the fastest MySQL adoption release ever ! Copyright @ 2020 Oracle and/or its affiliates. 96 / 96