How to debug MySQL stored routines

from the Artful MySQL Tips List

MySQL Workbench does not have a stored routine debugger. What are our options?

Open source solutions

Stubs: At key points in the code, add Select statements which execute if a debug flag or parameter is set.

Data driven stubs: Give the routine a debug flag or parameter, and code it to save variable names and values to the debug table when the debug flag is set. For mature examples of this approach see ...

Stored procedure debugger in MySQL Connector/NET: Version 6.6 introduced a stored procedure debugger that works inside Visual Studio. "Functions and triggers will be enabled in a future build."


Visual Studio debugger

Commercial solutions

dbForge for MySQL:


Last updated 29 Oct 2020

Return to the Artful MySQL Tips page