Getting data from the Metric Insights database

This article explains how to get data from the Metric Insights (dashboard) database so that it can be used for reporting usage statistics.on your Metric Insights instance.

1. Use a MySQL user named 'mi_read'

We have a number of MySQL users already set up. You can find the credentials in the file named /etc/mi/insight.conf. You probably want the one named mi_read.

2. Logon as 'root' to configure bind address

We generally configure MySQL to listen for incoming traffic from localhost only. You'll need to open it up to all comers. (MySQL does not provide a halfway measure.)

You can do that by editing the file named /etc/mysql/conf.d/01_insight_settings.cnf and creating the following entry:

bind-address             = 0.0.0.0

3. Adjust the permissions for 'mi_read' user

Launch mysql from command line, signing in with a mysql user who has root privileges. e.g., the 'root' user:

mysql -uroot -p

 

Within mysql, run these commands after replacing the <password> with the password for the mi_read user (you can get that from: /etc/mi/insight.conf) :

GRANT USAGE ON *.* TO 'mi_read'@'%' IDENTIFIED BY '<password>';

GRANT SELECT ON `dashboard`.* TO 'mi_read'@'%';

GRANT SELECT ON `dashboard\_report\_data\_segment\_%`.* TO 'mi_read'@'%';

FLUSH PRIVILEGES;

 

Note: if you get the following error then you will need to launch mysql with user with correct privileges:

mysql> GRANT USAGE ON . TO 'mi_read'@'%' IDENTIFIED BY 'password123';

ERROR 1045 (28000): Access denied for user 'mi_setup'@'localhost' (using password: YES)

ERROR 1410 (42000): You are not allowed to create a user with GRANT

2 Comments

colin

which user should i run step 3 as?

i'm getting this error:

[root@MetricInsights-Centos-64-bit conf.d]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 445956
Server version: 5.5.40 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select user();
+--------------------+
| user() |
+--------------------+
| mi_setup@localhost |
+--------------------+
1 row in set (0.00 sec)

mysql> grant usage on *.* to 'mi_read'@'localhost' identified by 'replaced!!';
ERROR 1045 (28000): Access denied for user 'mi_setup'@'localhost' (using password: YES)

Aaron Cho

Hi Colin,

I'll contact you directly via zendesk about logging onto mysql as root. Expect an email shortly.

Thanks,
Aaron

Add your comment

E-Mail me when someone replies to this comment