[root@j ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 1846410
Server version: 5.5.60-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS grafana DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> create user grafana@'%' IDENTIFIED by 'grafana';
Query OK, 0 rows affected (0.11 sec)
MariaDB [(none)]> grant all privileges on grafana.* to grafana@localhost identified by 'grafana';
[root@jkweb ~]# vim /etc/grafana/grafana.ini
[paths]
[server]
[database]
type = mysql
host = 10.0.0.18:3306
name = grafana
user = grafana
password =grafana
url = mysql://grafana:grafana@10.0.0.18:3306/grafana
重启grafana
[root@j ~]# systemctl restart grafana-server