That's by design.... influx2 nativly dropped the influxql language..
i'm using the "Data Explorer" from Influx to create my queries and if the work, simply transfer them to grafana....
Otherwise have a look for DBRP for Compatiblity..
I also mentioned these issue in my documentation for my plugin on GitHub - Dattel/homeassistant-influxdb2: Homeassistant Addon for InfluxDB2 · GitHub
If you need v1.x compatiblity for e.g. grafana, you have to create a retention policy for the database and a user for authentification. Replace the @bucket@ with your value.
Retention Policy
influx v1 dbrp create \
--db homeassistant \
--rp autogen \
--bucket-id @bucket@ \
--default
Create User for authentification ====
influx v1 auth create \
--read-bucket @bucket@ \
--write-bucket @bucket@ \
--username homeassistant