Actually since barnyard2 supports pkgng build options remove the WITH_MYSQL and WITH_PERFPROFILE from build options to not link snort to mysql.