MySQL Connection

Host
Database
User
Session Timezone Specify the time zone used in the database session, e.g. Europe/Berlin or +02:00. This is necessary, if the timezone of the database (or the host of the database) is set to something other than UTC. The value is set in the session with SET time_zone='...'. If you leave this field empty, the timezone is not updated. You can find more information in the MySQL documentation.
Connection limits
Max open The maximum number of open connections to the database. If Max idle connections is greater than 0 and the Max open connections is less than Max idle connections, then Max idle connections will be reduced to match the Max open connections limit. If set to 0, there is no limit on the number of open connections.
Max idle The maximum number of connections in the idle connection pool. If Max open connections is greater than 0 but less than the Max idle connections, then the Max idle connections will be reduced to match the Max open connections limit. If set to 0, no idle connections are retained.
Max lifetime The maximum amount of time in seconds a connection may be reused. If set to 0, connections are reused forever.

This should always be lower than configured wait_timeout in MySQL.

MySQL details

Min time interval A lower limit for the auto group by time interval. Recommended to be set to write frequency, for example 1m if your data is written every minute.
User Permission

The database user should only be granted SELECT permissions on the specified database & tables you want to query. Grafana does not validate that queries are safe so queries can contain any SQL statement. For example, statements like USE otherdb; and DROP TABLE user; would be executed. To protect against this we Highly recommmend you create a specific MySQL user with restricted permissions. Checkout the MySQL Data Source Docs for more information.