【问题标题】:Grafana with MySQL: this authentication plugin is not supported带有 MySQL 的 Grafana:不支持此身份验证插件
【发布时间】:2018-10-10 07:15:40
【问题描述】:

我正在尝试将一些数据从 MySQL 加载到 Grafana,但出现以下错误。知道我错过了什么吗?谢谢!

【问题讨论】:

    标签: mysql grafana


    【解决方案1】:

    碰巧grafana没有维护名为caching_sha2_password的新mysql授权方法。将 mysql 8 设置为默认设置。 要解决此问题,您只需使用mysql_native_password 身份验证插件连接器创建新用户。

    第 1 步。检查可用用户及其插件。

    MySQL [localhost+ ssl] SQL> select user, plugin from mysql.user;
    +------------------+-----------------------+
    | user             | plugin                |
    +------------------+-----------------------+
    | pi               | caching_sha2_password |
    | mysql.infoschema | caching_sha2_password |
    | mysql.session    | caching_sha2_password |
    | mysql.sys        | caching_sha2_password |
    | root             | caching_sha2_password |
    +------------------+-----------------------+
    6 rows in set (0.0011 sec)
    

    所有用户都有caching_sha2_password授权插件。

    第二步,打开mysql工作台,连接数据库。

    执行查询

    CREATE USER 'native_user'@'localhost' IDENTIFIED WITH mysql_native_password;
    

    结果一定是这样的

    09:30:17    CREATE USER 'native_user'@'localhost' IDENTIFIED WITH mysql_native_password 0 row(s) affected   0.156 sec
    

    步骤3.在mysql workbench中打开服务器->用户和权限

    从列表中选择 native_user。 更改此用户的密码、默认 shema 和 shema 权限。保存更改。

    步骤 4. 使用 mysql shell 检查

    MySQL [localhost+ ssl] SQL> select user, plugin from mysql.user ;
    +------------------+-----------------------+
    | user             | plugin                |
    +------------------+-----------------------+
    | pi               | caching_sha2_password |
    | mysql.infoschema | caching_sha2_password |
    | mysql.session    | caching_sha2_password |
    | mysql.sys        | caching_sha2_password |
    | native_user      | mysql_native_password |
    | root             | caching_sha2_password |
    +------------------+-----------------------+
    6 rows in set (0.0011 sec)
    

    步骤 5. 打开 grafana 数据源并设置新用户。

    祝你好运!

    附:我无法使用 mysql 工作台创建带有mysql_native_password 的新用户。也许它的错误。请改用命令提示符。

    【讨论】:

      【解决方案2】:

      谢谢。下面也可以。无需创建新用户。

      select user,plugin from mysql.user;
      alter user root@'localhost' identified with mysql_native_password by 'my_password';
      select user,plugin from mysql.user;
      

      【讨论】:

        猜你喜欢
        • 2021-07-14
        • 2018-12-06
        • 1970-01-01
        • 2017-07-01
        • 2019-02-09
        • 2016-12-01
        • 1970-01-01
        • 2017-05-31
        相关资源
        最近更新 更多