As the mode 'ONLY_FULL_GROUP_BY' is ON by default on MySQL 5.7, non ONLY_FULL_GROUP_BY queries in Koha will be rejected. This caused several issue including the error when adding a new patron even the patron categories exist.
*** Bug 16564 has been marked as a duplicate of this bug. ***
Marking this duplicate to the omnibus bug for supporting newer MySQL versions. *** This bug has been marked as a duplicate of bug 17258 ***