If you’re getting an error that reads “This version of MySQL doesn’t yet support ‘EXPLAIN ANALYZE FOR CONNECTION’” in MySQL, it’s probably because you’re trying to use the FOR CONNECTION
option with EXPLAIN ANALYZE
, but EXPLAIN ANALYZE
doesn’t support the FOR CONNECTION
option.
It’s true that we can use the FOR CONNECTION
option with the EXPLAIN
statement, we can’t use it when using the ANALYZE
variant of EXPLAIN
(we can use EXPLAIN
with or without ANALYZE
). At least, this is how it works as of this writing (MySQL 8.3).
To fix, either remove the ANALYZE
keyword from the statement or don’t use the FOR CONNECTION
option.