Update: On September 21, 2021, using MySQL 8 and Ubuntu 20.04, the solution to this problem was to edit this file:
/etc/mysql/mysql.conf.d/mysqld.cnf
Then add this configuration line to the end of that file:
sql_mode = ""
Once I did that, the problem described below went away.
Note that you can use this command to show your MySQL version on Ubuntu Linux:
$ mysql -V
mysql Ver 8.0.26-0ubuntu0.20.04.2 for Linux on x86_64 ((Ubuntu))
Background and older solution
NOTE: Everything below this point describes the background to this problem, and solutions I used with older versions of MySQL and Ubuntu Linux.
As a brief note to self, I ran into this MySQL error when running a SQL SELECT and GROUP BY query:
02:14:33.911 [main] ERROR scalikejdbc.StatementExecutor$$anon$1 - SQL execution failed
(Reason: Expression #3 of SELECT list is not in GROUP BY clause and contains
nonaggregated column 'aad8final.u.alias' which is not functionally dependent on columns
in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by):
select tn.nid, count(tn.nid) as countOfTnNid, u.alias, n.title
from taxonomy_index tn, url_alias u, node_field_data n
where tn.tid in (select tid from taxonomy_index where nid = 9423)
and tn.nid = u.nid
and tn.nid = n.nid
and n.status = 1
and n.nid != 9423
group by tn.nid
order by countOfTnNid
desc limit 5