Hi Bjorn,
You could define actions that insert directly into you mysql database like:
actionban = printf %%b "insert into table('ban', '<ip>', <failures>, '<name>');" | mysql -u user, --password=password database
Have also à look to following web page...