2

Someone can help me please , I want to log error about triggers in MySQL 5.5 I'll like to know if it's possible to know if a trigger was'nt fired ?

2
  • When the trigger was created successfully, you can safely assume that it's fired when the appropriate DML statement is executed.
    – tombom
    Commented Jan 27, 2015 at 12:38
  • Write something in a temporary table if you wish.
    – tombom
    Commented Jan 27, 2015 at 12:50

1 Answer 1

2

You can do it the hard way by enabling MySQL logging (all SQL queries will be logged). I'm doing it when I'm trying to debug & understand complex code base with big amount of SQL queries, with SQL procedures, events & triggers. It's ugly, but it works.

https://support.plesk.com/hc/en-us/articles/213374189-How-to-enable-MySQL-logging-

How to Log All mysql queries into log file?

Debian-based systems:
/etc/mysql/my.cnf

[mysqld]
# Set Slow Query Log
long_query_time = 1
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log
log_queries_not_using_indexes = 1

# Set General Log
general_log = on
general_log_file = /var/log/mysql/mysql-general.log

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.