MySQL does not have a spam filter engine if that is what you were asking. But here's what you can do to combat spam combats
You can make your own spam filter to flag comments containing any of the following
WORDS. That's what many spam filters use.
Or you can just make it that each comment has to be moderated by you. That means you have to code such functionality and a moderating admin panel for that. A lot of large, small and medium sites use this
If you are using CMS' like Wordpress, Drupal e.t.c, there are a lot of plugins for that.