0

I would like to debug my stored procedures properly, the easiest way i can think of is to be able to send debug messages to the log file of mysql. is that possible ?!

2 Answers 2

2

You can install the User Defined function that is available here...

https://github.com/mysqludf/lib_mysqludf_log

and then use it anywhere in the select query like...

mysql> SELECT log_error(concat(now(), 'error in selecting line 13'));
+--------------------------------------------------------+
| log_error(concat(now(), 'error in selecting line 13')) |
+--------------------------------------------------------+
|                                                      0 |
+--------------------------------------------------------+
1 row in set (0.00 sec)

# tail /var/log/mysqld.log
2010-12-02 03:16:03error in selecting line 13
Sign up to request clarification or add additional context in comments.

1 Comment

dead link, but got the idea
2

As I have not heard of anything like that I will recommend you this http://benjisimon.blogspot.com/2007/02/debugging-mysql-stored-procedures.html

or read this topic How do you debug MySQL stored procedures?

1 Comment

welp if there isn't any way to send messages to the log file, the method of creating a log table and inserting log strings to that table is a suitable answer for me. thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.