Dashboard views can't work normally when version of mysql change to 8.0.18 from 5.7.29

when I change mysql version to 8.0.18, the dashboard views can’t work normally. It’s ok when mysql version is 5.7.29.

error message(visits over time module of dashboard page):
SQLSTATE[HY000]: General error: 3750 Unable to create or change a table without a primary key, when the system variable ‘sql_require_primary_key’ is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting. - in plugin Goals

Hi,

see also Matomo on DigitalOcean Managed Database Cluster MySQL 8 - sql_require_primary_key error

The error message pretty much says what the issue is:

Matomo creates temporary MySQL tables for a few things and as they only have one column, they don’t really need a primary key, so they don’t have one.
But if you set your MySQL up to never allow a table without a primary key (sql_require_primary_key), it won’t allow Matomo to create these tables.

This has been solved here: