• All
  • Test
  • Startup
  • Experience Case
  • FAQ
Product line
Search
Cancel
Documents type
Author
Time
Search

The iMC failed to manage the mysql database.

2022-06-21 11:57:49 Published
  • 0Followed
  • -1Collected ,328Browsed
fans:1 follow:0

Network Topology

irrelevant

Problem Description

In ysql8.0.27, monitoring cannot be added through apm, and a database connection error is reported. You can connect from the database server background, but cannot connect to the database from other terminals.

Process Analysis

After installing the locally deployed imc+mysql according to the manual, the permission to log in to the database remotely is restricted, and only the local root user can log in to mysql.


[root@centos log]# mysql -u root -pxxx        (xxx means the psw)

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 5301

Server version: 8.0.27 MySQL Community Server - GPL

 

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

 

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>

mysql>

mysql> use mysql;

Database changed

mysql> select host,user from user;

+-----------+------------------+

| host      | user             |

+-----------+------------------+

| %         | ead              |

| %         | imc_aclm         |

| %         | imc_apm_config   |

| %         | imc_apme         |

| %         | imc_bsm          |

| %         | imc_cmdb_new     |

| %         | imc_config       |

| %         | imc_icc          |

| %         | imc_inventory    |

| %         | imc_monitor      |

| %         | imc_perf         |

| %         | imc_ssa          |

| %         | imc_syslog       |

| %         | imc_vlan         |

| %         | imc_vnm          |

| %         | report           |

| %         | reportplat       |

| localhost | mysql.infoschema |

| localhost | mysql.session    |

| localhost | mysql.sys        |

| localhost | root             |

+-----------+------------------+

21 rows in set (0.00 sec)

The permission for querying the root account is only localhost. % indicates all accounts.


Solution

1.Remove account restrictions and release the remote login authority of the account.

mysql> update user set host='%' where user='root';

Query OK, 1 row affected (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 0

 

mysql> select host,user from user;

+-----------+------------------+

| host      | user             |

+-----------+------------------+

| %         | ead              |

| %         | imc_aclm         |

| %         | imc_apm_config   |

| %         | imc_apme         |

| %         | imc_bsm          |

| %         | imc_cmdb_new     |

| %         | imc_config       |

| %         | imc_icc          |

| %         | imc_inventory    |

| %         | imc_monitor      |

| %         | imc_perf         |

| %         | imc_ssa          |

| %         | imc_syslog       |

| %         | imc_vlan         |

| %         | imc_vnm          |

| %         | report           |

| %         | reportplat       |

| %         | root             |

| localhost | mysql.infoschema |

| localhost | mysql.session    |

| localhost | mysql.sys        |

+-----------+------------------+

21 rows in set (0.00 sec)

 

mysql> alter user 'root'@'%' identified with mysql_native_password by 'iMC_123456';

Query OK, 0 rows affected (0.00 sec)

 

mysql> grant all privileges on *.* to root@'%' with grant option;

Query OK, 0 rows affected (0.00 sec)

 

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

Please rate this case:   
1 comments
level
fans:0 follow:13

Add Comments:

举报

×

侵犯我的权益 >
对根叔知了社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔知了社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明

提出建议

    +

Login before you can operate!

login

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作