Help me to configure Grafana SqlDB

Hi all,
I am new in this community and I started to work on programming from a couple of weeks…
I have to link Grafana (port localhost:3000) to MySQL (port localhost:3306).
I already configured default.ini file.
I launch grafana-server from prompt (on Windows platform): no problem till here.
When I try to configure Datasources (SqlDB), Grafana give me this error: “Unknown error
Cannot read property ‘indexOf’ of undefined” and on prompt I read: "http: proxy error: malformed HTTP response “J\x00\x00\x00"←[32mINFO←[0m[05-05|09:17:16] Request Completed”.
MySQL is correctly running and I verifyed that Grafana can write on DB.
Someone could help me, please?

It seems you are confusing two things here - the internal Grafana db and using a SQL data source.

Grafana uses an Sql Database (sqlite, postgres or mysql) for Grafana settings (dashboards, users etc.). This is configured via the ini file. You can check that these are correct here: http://localhost:3000/admin/settings

These are the default Database settings which use Sqlite. In your settings the type should be mysql and not sqlite3. As you said that it writes data, then it sounds like these settings are correct.

If you want to have graphs that show data from your MySql db, then that is a separate issue and you need to have a data source. It seems you are using an unofficial plugin for SQL? Have you tried contacting them on GitHub?

We are going to release a new MySql data source plugin in the next few days (it is already in the nightly builds but will be included in version 4.3.0) and that might be a better option.

Thank you for the support!
If I well understood the Grafana DB is correctly configured:

but the problem is the Datasources that I used.
I will waiting your new release of plugin!! :wink:

(However I have the same problem with Graphite, Prometheus (HTTP ERROR - Bad Gateway) and so on…)

I will try with new plugin and if I have issues I will ask again.
Thank you!

That doesn’t sounds good if you are getting bad gateway errors. Just to double check -> what mode did you choose when creating the data source, Direct or Proxy. Proxy is usually what you will want.

I choose Proxy mode.

Bad gateway means that your grafana server cannot access the servers where Graphite/Prometheus are located. Can you ping those servers?

Yes, below the results:

All is in localhost:

  • Grafana on localhost:3000;
  • MySQL on localhost:3306.

I report you also Grafana database view from MySQL:

You mentioned Graphite and Prometheus, are they on localhost too?

Yes, all on localhost.

So for your Graphite db, can you access Graphite Web on http://localhost:8080?

And for Prometheus, can you access the Web UI on http://localhost:9090?

For Prometheus yes :sunglasses:

Now the error message changed (with Prometheus): new error in Datasources is “Forbidden”

(You sure understood that I am not an expert…I attach all I think can be helpful…)

Looks like it is not a problem with Grafana then. Do you have a port conflict? How can Prometheus and MySql be on port 3306?

:confused: … you are right…I check and Monday I will update the situation.
Thanks a lot till now!

Hi, I hope your week end was fine!
Prometheus runs well:

But now, how should I do to link Prometheus to MySQL?

Not sure I understand? How do you want to link Prometheus and MySql? You mean you want to monitor MySQL with Prometheus?

Yes.
Do you think is not the better solution?