Q:

How to make Emacs sql-mode recognize MySQL #-style comments?

I'm reading a bunch of MySQL files that use # (to end-of-line) comments, but my sql-mode doesn't support them.  I found the syntax-table part of sql.el that defines /**/ and -- comments, but according to this, Emacs syntax tables support only 2 comment styles.
Is there a way to add support for # comments in sql.el easily?

A:

Emacs-24 sql.el has this built-in!  Simply run M-x sql-set-product MySQL RET and the syntax table is set up automatically, as are the font-lock-keywords for all the additional reserved words and types, interactive-mode, etc, etc.  Brilliant!!
Of if you look under SQL in the menubar you can use the Product submenu to select MySQL.
You can also M-x customize-variable sql-product RET to set the default product away from ANSI.

