Grafana 10.2.0 - MySQL Deprecation warning

Hello guys, I have upgraded my Grafana from 10.1.5 to 10.2.0, and I’m using embedded panels on my website, but now I’m getting a warning every time a panel it’s loaded, and since I’m new to Grafana, I’m not figuring out what’s the problem.

Can someone help me?

I’m using MySQL code option, to build my panels, based on raw SQL querys.

Are you doing some dynamic mysql query or some custom mysql queries with variables etc

I think this warning might be some changes done with mysql datasource to avoid sql injection? Just a wild guess

Can yoilu show us some sample queries used with filters?

Hi, thanks for trying to help.

Yes I’m doing something like this

SELECT STR_TO_DATE(CONCAT(year, '-01-01'), '%Y-%m-%d') AS time, quantity
FROM net4co2.ghg_country_level_totals
WHERE category = '$category' AND gas_type = '$gas'
ORDER BY time;

These variables are passed via url like

http://domain.local/grafana/d-solo/c4rtr-aswdas-23423-sdfsd/my-dashbaord?orgId=1&theme=light&panelId=2&var-category=TGL&var-gas=CH₄

I thought it could be because of the variables, but I tried to create a new panel without any variables and I keep receiving warnings

1 Like

Those look safe. I would ignore it since it is just a deprecation warning.

For future upgrades just test things out in test environment before upgrading the live version

1 Like

Okay, thanks