I have encountered a problem while configure barnyard2 with mysql on unbuntu server 12.04, it turns out that the package libmysqlclient16-dev was deleted from the repository, if you need to get the package you need to add the repo into your sources.list. Without this package you cannot configure barnyard2 that uses the libmysqlclient16-dev library file.
Follow the instruction here.