grafana面板改为存到mysql:


# mysql -u root -p'xxxxxx'

> create database grafana;

> grant all on grafana.* to grafana@'localhost' identified by 'xxxxx';

> flush privileges;


# vi /etc/grafana/grafana.ini



[database]


#;type = sqlite3

type = mysql

host = 127.0.0.1:3306

#;name = grafana

name = grafana

#;user = root

user = grafana

#;password =

password = xxxxx



#;path = grafana.db



[session]


#;provider = file

provider = mysql



provider_config = grafana:xxxxxx@tcp(127.0.0.1:3306)/grafana


cookie_name = grafana_sess

cookie_secure = false

session_life_time = 86400


# service grafana-server restart