Wednesday, March 30, 2022

How to change database to mysql

 Default database used for grafana is sqlite.


You can install mysql database and configure grafana to use that by following steps in this link


mysql -u root -p

> show databases;

remaining steps in above link


nano /etc/grafana/grafana.ini

-------------------

url =mysql://grafana:grafana@localhost:3306/grafanadb


Instead of url, we can comment url portion and provide details as below.


type = mysql

host = localhost:3306

name = grafanadb

user = grafana 

password = Grafana@2020


------------


On windows machine, c:\program files\GrafanaLabs\grafana\conf\defaults.ini

copy sample.ini and rename it to custom.ini

Non-default changes should be written in custom.ini

services.msc --> Grafana service-->stop the service before any configuration changes and start after that.

cutom.ini, change sqllite to mysql and other details as you see in linux configuration.


No comments:

Post a Comment