mysql - Grafana 与 MySQL:不支持此身份验证插件
解决方案
它的偶然原因是grafana不维护名为caching_sha2_password
. 将 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
授权插件。
步骤 2. 打开 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_native_password
PS 我无法使用 mysql 工作台创建新用户。也许它的错误。请改用命令提示符。
推荐阅读
- excel - 用于搜索、匹配和粘贴的 VBA 字典:未知错误
- sql - 如何在 oracle 中连接表 1 中的多个其他表中的 100 个随机行
- laravel - Laravel FileBag 限制为 20 个文件
- angular - 元素 href 停止使用(单击)它
- python-3.x - sigmoid() 接受 1 个位置参数,但给出了 2 个
- javascript - 如何从 javascript 文件中获取函数的值到 ASP.NET MVC 视图?
- html - 如何使用表格在行上添加边框?
- ruby-on-rails - ActiveRecord 对同一用户在过去一小时内创建的帖子进行分组
- google-drive-api - Ansible - 从 Google Drive 下载文件
- angularjs - Angularjs 使用 FileReader 获取文件 url