• Stars
    star
    123
  • Rank 283,460 (Top 6 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 4 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Plugins for MySQL Shell

mysql-shell-ex

A collection of MySQL Shell example plugins (MySQL Shell >= 8.0.22).

After installing this plugin collection into the .mysqlsh/plugins/ folder, all the plugins will be automatically loaded at MySQL Shell startup.

To get help about the individual plugins type \? <plugin>.

MySQL JS> \? schema_utils
NAME
      schema_utils - Schema management and utilities.

DESCRIPTION
      A collection of schema management tools and related utilities that work
      on schemas."

FUNCTIONS
      deleteProcedures([schema][, routine][, session])
            Delete stored procedures.

      help([member])
            Provides help about this object and it's members

      showDefaults(table[, schema][, session])
            Lists the default values of each column in a table.

      showInvalidDates([table][, schema][, session])
            Show Invalid Dates

      showProcedures([schema][, session])
            Lists all stored procedures of either all schemas or a given
            schema.

      showRoutines([schema][, session])
            Show Routines.


MySQL JS> schema_utils.showProcedures()
+----------------+-------------------------------------+
| ROUTINE_SCHEMA | ROUTINE_NAME                        |
+----------------+-------------------------------------+
| sys            | extract_schema_from_file_name       |
| sys            | extract_table_from_file_name        |
...

MySQL JS> \py
Switching to Python mode...

MySQL PY> schema_utils.show_procedures()
+----------------+-------------------------------------+
| ROUTINE_SCHEMA | ROUTINE_NAME                        |
+----------------+-------------------------------------+
| sys            | extract_schema_from_file_name       |
| sys            | extract_table_from_file_name        |
...

Installation

To install this demo on your machine type the following commands after you have installed the MySQL Shell and the git command line tools.

This will clone the repository and copy the files to the right path in order to be automatically loaded on MySQL Shell startup.

macOS / Linux

$ mkdir -p ~/.mysqlsh/plugins
$ git clone https://github.com/lefred/mysqlshell-plugins.git ~/.mysqlsh/plugins

Windows

$ mkdir %AppData%\MySQL\mysqlsh\plugins
$ git clone https://github.com/lefred/mysqlshell-plugins.git %AppData%\MySQL\mysqlsh\plugins

Missing Modules

It might be possible that for some plugins, your are missing some modules. Usually it is python3-requests.

You can then just install it. However, on some systems, the version of Python 3 doesn't match the version linked with MySQL Shell. This is the case with OL7/OL8 where Python 3.6 is installed and MySQL Shell Enterprise build provides Python 3.7.

If this is the case for you, you can install the missing modules within MySQL Shell too using mysqlsh --pym pip.

Example with requests:

For the router and proxySQL plugin, requests is required, if you don't have it installed, when you start MySQL Shell, you will get this message:

Error importing module 'requests', check if it's installed (Python 3.7.7)

You have 2 options, install it system wide (available for all users), if you have root access, or just for your user:

$ sudo mysqlsh --pym pip install requests

or

$ mysqlsh --pym pip install --user requests

That's it !

Extending the MySQL Shell

Please take a look at the demo/init.py file to learn how to extend the MySQL Shell with plugins.

More Repositories

1

mysql_gr_routing_check

MySQL Group Replication Routing/Heath Check script
Shell
42
star
2

innotopgo

Innotop for MySQL 8 written in Go
Go
41
star
3

percona-cluster

Percona XtraDB Cluster test
Puppet
32
star
4

online-migration

MySQL schema versioning and migration management utility
Python
27
star
5

MyUndelete

Undelete deleted rows from MySQL ROW binary logs
Python
26
star
6

mysql-shell-mydba

MySQL Shell DBA Toolkit
Python
21
star
7

mysql-shell-innotop

Innotop like module in MySQL Shell
Python
17
star
8

proxysql_groupreplication_checker

MySQL Group Replication scheduler script for ProxySQL
Shell
15
star
9

puppet-lefred-innodbcluster

Puppet module for MySQL InnoDB Cluster
Puppet
8
star
10

mysql-component-uuid_v7

MySQL Component to generate UUID_v7
C++
8
star
11

maskit

rules generator example script for PropxySQL to help maksing or obfuscating data
Shell
8
star
12

vagrant-mha

Vagrant for MySQL MHA
Ruby
6
star
13

mysql-shell-udr

MySQL Shell User Defined Reports Examples
Python
6
star
14

puppet-cluster

pacemaker / corosync puppet recipe
Ruby
6
star
15

oci-mysql-idc

OCI Quickstart for MySQL InnoDB Cluster
HCL
5
star
16

percona-prm

Percona Replication Manager (ocf agent for Pacemaker)
Shell
5
star
17

oci-wordpress-mds

Deploy Wordpress on OCI using MDS
HCL
5
star
18

facter-mysql

mysql facter
Ruby
5
star
19

odl-mysql-idc-terraform-hol

Oracle Developer Live MySQL - HOL: Deploy MySQL InnoDB Cluster with Terraform
JavaScript
4
star
20

MySQL-motd

motd for MySQL
4
star
21

mysql-docstore-php-example

Some fun with PHP and MySQL Document Store
PHP
4
star
22

mysqlGR-vagrant

Vagrant and Puppet environment for MySQL Community Group Replication
Puppet
3
star
23

pfs2elastic

MySQL Performance Schema to Elasticsearch
Ruby
3
star
24

pluk-devops

MySQL DBADEVOPS
Ruby
3
star
25

oci-iot-mds

Oracle Pi Day OCI Resource Manager Stack
HCL
3
star
26

oracle-piday-2022

Oracle PiDay 2022 - IoT to MySQL HeatWave
Python
2
star
27

mailspring-libre-gtg

GTG plugin for Mailspring-Libre
JavaScript
2
star
28

percona-puppet-haproxy

Split of puppet-haproxy from percona-cluster
Puppet
2
star
29

binlog_streaming

binlog streaming init script
Shell
2
star
30

vim

.vim with a copy of .vimrc on it
Python
2
star
31

percona-puppet-percona

Split of puppet-percona from percona-cluster
Puppet
2
star
32

percona-puppet-myhosts

Split of puppet-myhosts from percona-cluster
Puppet
2
star
33

mailspring-libre-aria

Mailspring Libre Plugin to add link to Oracle Employee Portal (ARIA)
JavaScript
2
star
34

oci-phpmyadmin-mds

Terraform and Ressource Manager Stack for MySQL Database Service and PHPMyAdmin
HCL
2
star
35

puppet-funambol

Funambol puppet recipe
Ruby
2
star
36

oci-nextcloud-mds

OCI Terraform modules to deploy NextCloud with MySQL Database Service and Object Storage
HCL
2
star
37

mysql-component-viruscan

Extending MySQL using the Component Infrastructure - Code example
C++
2
star
38

monitorViaHttp

HTTP monitoring endpoint
Python
2
star
39

puppet-fusioninventory

fusion inventory agent recipe
Ruby
2
star
40

puppet-ox

Open-Xchange puppet recipe
Ruby
2
star
41

oci-mds-multi-region

Deploy MySQL Database Service on multiple regions with Terraform
HCL
2
star
42

oci-php-mds

Terraform Code to install PHP on Oracle Cloud Infrastructure using MySQL Database Service
HCL
2
star
43

percona-puppet-xinet

Split of puppet-xinet from percona-cluster
Puppet
2
star
44

oci-joomla-mds

Deploy Joomla! on OCI with MDS and Resource Manager Stack or Terraform
HCL
2
star
45

puppet-cyrus

Cyrus imap recipe (can be used for two nodes server/slave)
Ruby
1
star
46

puppet-lefred-mysql

MySQL puppet module that handles all MySQL distributions (Community, Percona, MariaDB) for CentOS/RHEL
Ruby
1
star
47

puppet-lefred-postgresqldbr

PostgreSQL BDR puppet module
Puppet
1
star
48

banquise-client

Client part of the banquise project written in python
Python
1
star
49

percona-puppet-mysql

Split of puppet-mysql from percona-cluster
Ruby
1
star
50

oci-mysql-config

Example of MySQL Database Service Configuration to deploy on OCI with Terraform
HCL
1
star
51

percona-puppet-galera

Split of puppet-galera from percona-cluster
Puppet
1
star
52

oci-CiviCRM-WP-mds

Stack Resource Manager to Deploy CiviCRM with Wordpress on OCI & MDS
HCL
1
star
53

puppet-clamd

clamd puppet recipe
Ruby
1
star
54

puppet-backupPC

backupPC puppet recipe
Ruby
1
star
55

mysql-component-disksize

MySQL Component to display disksize
C++
1
star
56

mysql-devops

devops demo for MySQL
Shell
1
star
57

GR_Demo_Router

MySQL InnoDB Cluster Demo kit for MySQL Router
JavaScript
1
star
58

redis-todo

Todo List in NodeJS with Redis
EJS
1
star
59

mysql-component-uuid_v4

MySQL UUID v4 generator function
C++
1
star
60

oci-superset-mds

OCI Terraform for Apache Superset and MySQL Database Service
HCL
1
star
61

centipede

centipede scanner
Python
1
star
62

puppet-cobbler

Cobbler puppet recipe
Ruby
1
star
63

rpm-spec

some spec for rpms
Shell
1
star
64

CardsAgainstMySQLCommunity-cards

White & Black cards for Cards Against MySQL Community
1
star
65

plmce-devops-tuto

A MySQL module supporting all flavors
Ruby
1
star
66

amex-motd

Amex, God motd
1
star
67

mysql-plugin-flush_rewriter

MySQL Rewrite Plugin to force FLUSH statements to be LOCAL
C++
1
star
68

banquise

banquise [bãkiz] is a (yet another) package manager.
Python
1
star
69

oci-zeppelin-mds

Terraform modules for Apache Zeppelin in OCI with MDS
HCL
1
star
70

mysql-component-uuid_v1

MySQL 8 component to extract timestamp from uuid
C++
1
star
71

bk-tools

Scripts I wrote to help using MySQL and Percona products.
Perl
1
star
72

oci-wordpress-free

Deploy WordPress and MySQL Community Server on an always Free Ampere compute instance in Oracle Cloud Intrastructure (OCI) using these Terraform modules
HCL
1
star