# 创建权限用户 root@cby:~# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7137 Server version: 8.0.35 MySQL Community Server - GPL
Copyright (c) 2000, 2023, 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> CREATE USER 'netdata'@'localhost' IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.52 sec) mysql> GRANT USAGE, REPLICATION CLIENT, PROCESS ON *.* TO 'netdata'@'localhost'; Query OK, 0 rows affected (0.01 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.13 sec) # 配置Netdata的mysql.conf root@cby:/etc/netdata# cd /etc/netdata root@cby:/etc/netdata# sudo ./edit-config go.d/mysql.conf
······略······ # netdata - name: local dsn: netdata:password@unix(/var/lib/mysql/mysql.sock) - name: local dsn: netdata:password@tcp(127.0.0.1:3306)/db_test ······略······ # 异常查看 root@cby:/etc/netdata# cd /usr/libexec/netdata/plugins.d/ root@cby:/etc/netdata# sudo -u netdata -s root@cby:/etc/netdata# ./go.d.plugin -d -m mysql