This seems to be the same issue as reported here, but honestly I have no idea why. Maybe your MySQL error log has more information as to why MySQL rejects this query:
You could also try to enable query logging to find the exact SQL query that triggers the error:
I have manual take a update and copied/replaced all files, except config-file and repaired all tables in database. Error still exists.
I can login, I can change matomo settings and save them, remove and add widgets, so I can access successful the database, but widgets and stats are broken.
Damn, I have the same issue then… my console:archive call stops with:
INFO [2019-11-30 21:18:19] 1312 Error: Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=day&date=last2&format=php&trigger=archivephp. Response was ‘a:2:{s:6:“result”;s:5:“error”;s:7:“message”;s:241:"SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user ‘user’@’%’ to database ‘blabla’, caused by: SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user ‘user’@’%’ to database ‘blabla’";}’
It is % here which is fine as for mySQL the user is accepted from any host. I have dozens of PERL scripts running like this on this machine with users configured like that.
In the config.ini.php the database is mentioned with 127.0.0.1 since the beginning and a different port than 3306. But as all the rest is working just only the archiving not i suspect that something must be wrong in the script doing that and not in my config.
One thing that changed in 3.12.0 was that now the mysql user requires the CREATE TEMPORARY TABLES permission. Can you check that your matomo db user has this permission?
For me too… I might suggest to add a proper error message to the script because creating temp tables is not a default right and I can imagine that a lot with restrictive rights will stumble over this issue not knowing what to do.