Hi i am using grafana first time please suggest me how to add a mysql data source into grafana
Go to Datasources, give the url link of where your sql db is stored
ex:- yourserver:port number
ex:-localhost:8000(change it to whichever port youre running sql on)
hi,
i have a little bit of idea about it hope it can help you
Go to Datasources ->select type as mysql->the give url on which your mysql is working (it generally works on 3306 port)->then enter database name -> and enter username and password of your mysql then the connection will be created.
Please refer to the documentation
Hi, I have the same doubt about it. I have followed all the steps described in documentation and the step described by geetu and I am getting an error in my grafana:
Templating init failed
Error 1146: Table âmy2.statusâ doesnât exist
I google it but couldnât find any awnser about this error. Can anyone help?
Thanks
That error tells you that you have a template variable defined in a dashboard that tries to read from my2.status table which you doesnât seem to have in your database.
Hello @danilofm
It looks like youâve installed the dashboard but not the necessary database for use with that dashboard. I ran into the same. See the authors git repo here. It will import a my2 table with some stored functions.
I had my2 installed and using mysql and it was working.
Now the native plugin for mysql is missing and giving the same error as above.
Not sure where mysql plugin went. Cannot even add a new dashboard with mysql as its no longer an option. Trying to find the plugin to re-install now.
Here is the log
t=2021-04-15T14:58:37+0000 lvl=eror msg=âquery errorâ logger=tsdb.mysql err=âError 1049: Unknown database âexampledbââ
t=2021-04-15T16:03:05+0000 lvl=info msg=âRequest Completedâ logger=context userId=1 orgId=1 uname=admin method=POST path=/api/dashboards/db status=412 remote_addr=192.168.220.54 time_ms=20 size=88 referer=âhttp://192.168.220.145:3000/d/*******/2mysql-simple-dashboard?orgId=1&from=1618400760373&to=1618433110141â
t=2021-04-15T17:56:20+0000 lvl=eror msg=âCould not find plugin definition for data source: mysqlâ
t=2021-04-15T17:56:20+0000 lvl=eror msg=âCould not find plugin definition for data source: mysqlâ
t=2021-04-15T17:56:33+0000 lvl=eror msg=âCould not find plugin definition for data source: mysqlâ
t=2021-04-15T17:56:33+0000 lvl=eror msg=âCould not find plugin definition for data source: mysqlâ
t=2021-04-15T17:56:33+0000 lvl=eror msg=âCould not find plugin definition for data source: mysqlâ
Did a dpkg install over the existing and mysql is now an option again.
Did not lose any of my existing dashboards
Hi i have added mysql datasource and its connection is ok but when i installed mysql dashboard in that dashboard it is not showing mysql datasource and it is only showing the prometheus datasource why?