Part 1. 分类

Stored Programs

  - Stored Routines

     - Procedure

     - Function


  - Event Scheduler  


  - Trigger


Part 2. 概要

MySQL Stored Programs Summary_Programs

MySQL Stored Programs Summary_Programs_02

MySQL Stored Programs Summary_Stored _03

MySQL Stored Programs Summary_Stored _04


另, 对于Event Scheduler和Trigger还各有一小点, 要了解到.


Event Scheduler在MHA环境下, 手动在线切换时, 会有如下信息提示, 要暂将Event Scheduler关闭.

Wed Sep 13 10:55:43 2017 - [error][/usr/local/share/perl5/MHA/MasterRotate.pm, ln161] We should not start online master switch when one of connections are running long updates on the current master(192.168.19.168(192.168.19.168:3306)). Currently 1 update thread(s) are running.

Details:

{'Time' => '147223','Command' => 'Daemon','db' => undef,'Id' => '117223','Info' => undef,'User' => 'event_scheduler','State' => 'Waiting on empty queue','Host' => 'localhost'}

Wed Sep 13 10:55:43 2017 - [error][/usr/local/share/perl5/MHA/ManagerUtil.pm, ln177] Got ERROR:  at /usr/local/bin/masterha_master_switch line 53.


Trigger不能建立在mysql数据库上, 会有如下报错.

ERROR 1465 (HY000): Triggers can not be created on system tables


若感兴趣可关注订阅号”数据库最佳实践”(DBBestPractice).MySQL Stored Programs Summary_点滴_05