ERROR: Unable to execute query

SELECT DISTINCT count(*) AS `total`,`group_member_user_id` FROM
               `group_members` AS gm,
               `groups` AS g WHERE
                gm.group_member_group_id=g.group_id
                GROUP BY gm.group_member_group_id

Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'filmesg_tb.gm.group_member_user_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by