zabbix3.0 monitoring MySQL service password-free login problem Troubleshooting detailed process

Source: Internet
Author: User

1,my.cnfInvalid user name password in

Above the azure cloud, using Zabbix monitoring MySQL, found in/usr/local/mysql/my.cnf set the default user name password is invalid, out of data, and on the Zabbix server, using Zabbix_get also error failed, As follows

[Email Protected]_serv_121_12 ~]#/usr/local/zabbix/bin/zabbix_get-s 192.168.13.13-p10050-kmysql.status[uptime]

/usr/local/mysql/bin/mysqladmin:connect toserver at ' localhost ' failed

Error: ' Access denied for user ' adminuser ' @ ' localhost ' (using Password:no) '

[[Email Protected]_serv_121_12 ~]#

2, try[Client]Invalid

Add the "Client" tab that all clients can use in/usr/local/mysql/my.cnf the user name password for MySQL is good

[Email protected]_test_dbm2_3_13 mysql]# vim.my.cnf

[Client]

Mysql_user=zabbix

password=ys_test0418

Then go to the Zabbix server and use get to test the

[[Email Protected]_serv_121_12 ~]#

[Email Protected]_serv_121_12 ~]#/usr/local/zabbix/bin/zabbix_get-s 192.168.13.13-p10050-kmysql.status[uptime]

/usr/local/mysql/bin/mysqladmin:connect toserver at ' l27.0.0.1 ' failed

Error: ' Unknown MySQL Server Host ' l27.0.0.1 ' (0) '

Check that Mysqld was running on L27.0.0.1and, the port is 3317.

You can check the this by doing ' telnetl27.0.0.1 3317 '

[[Email Protected]_serv_121_12 ~]#

This article source blog address: http://blog.csdn.net/mchdba/article/details/51344063, declined reprint.

3, continue to trymysqladminDebug Locally

Zabbix monitoring MySQL is to get MySQL database information by remotely invoking the local mysqladmin component of the MySQL server, so as long as the local MySQL server debugging passed, then it should be OK. First in the local password-free login debugging through it.

Try local mysqladmin, invalid:

[Email protected]_test_dbm2_3_13 zabbix]#/usr/local/mysql/bin/mysqladmin-hl27.0.0.1-uzabbix-pys_test0418-p3317- S/usr/local/mysql/mysql.sock extended-status grep-w com_update

Warning:using a password on the CommandLine interface can be insecure.

Got error:unknown MySQL Server Host ' l27.0.0.1 ' (0)

Try local MySQL, invalid:

[[Email Protected]_test_dbm2_3_13 zabbix]#/usr/local/mysql/bin/mysql-hl27.0.0.1-uzabbix-pys_test0418-p3317

Warning:using a password on the CommandLine interface can be insecure.

ERROR 2005 (HY000): Unknown MySQL serverhost ' l27.0.0.1 ' (0)

[Email protected]_test_dbm2_3_13 zabbix]# mysql-hl27.0.0.1-uzabbix-pys_test0418-p3317

Warning:using a password on the CommandLine interface can be insecure.

ERROR 2005 (HY000): Unknown MySQL Server Host ' l27.0.0.1 ' (0)

[Email protected]_test_dbm2_3_13 Zabbix] #mysql-uzabbix-pys_test0418-p3317

Warning:using a password on the CommandLine interface can be insecure.

ERROR 1045 (28000): Access denied for user ' Zabbix ' @ ' localhost ' (using Password:yes)

[[Email Protected]_test_dbm2_3_13 zabbix]#

Where is the problem?

4, findMySQLComponent-Awaremy.cnfthe path where

It seems that the default/usr/local/mysql/my.cnf configuration is not valid for login, then we need to look at the mysqladmin to identify which my.cnf and their path address:

[email protected]_test_dbm2_3_13 MySQL] #mysqladmin--help

......

Default options is read from the followingfiles in the given order:

/ETC/MY.CNF/ETC/MYSQL/MY.CNF/USR/LOCAL/MYSQL/ETC/MY.CNF ~/.my.cnf

......

[[Email Protected]_test_dbm2_3_13 mysql]#

ll see if you can find these profiles:

[Email protected]_test_dbm2_3_13 mysql]# ll/etc/my.cnf

Ls:cannot access/etc/my.cnf:no such fileor directory

[Email protected]_test_dbm2_3_13 mysql]# ll/etc/mysql/my.cnf

Ls:cannot Access/etc/mysql/my.cnf:nosuch file or directory

[Email protected]_test_dbm2_3_13 mysql]# ll/usr/local/mysql/etc/my.cnf

Ls:cannot access/usr/local/mysql/etc/my.cnf:no such file or directory

[Email protected]_test_dbm2_3_13 mysql]# ll~/.my.cnf

Ls:cannot access/root/.my.cnf:no suchfile or directory

[Email protected]_test_dbm2_3_13 mysql]# ll/usr/local/mysql/etc

Ls:cannot Access/usr/local/mysql/etc:nosuch file or directory

[[Email Protected]_test_dbm2_3_13 mysql]#

One also useless to find, originally my MySQL is the source code compiles, the compilation path is in/usr/local/mysql/my.cnf, but Mysqladmin does not recognize. So you need to install a new my.cnf.

5, prepare a newmy.cnf,OK

Select a/usr/local/mysql/in the MY.CNF path identified by the mysqladmin (/etc/my.cnf/etc/mysql/my.cnf/usr/local/mysql/etc/my.cnf ~/.my.cnf) ETC/MY.CNF, then create a new and record the user name password, then debug

# Prepare a new configuration file on MySQL server my.cnf

[Email protected]_test_dbm2_3_13 mysql]# mkdir/usr/local/mysql/etc

[[Email Protected]_test_dbm2_3_13 mysql]#

[Email protected]_test_dbm2_3_13 mysql]# vim/usr/local/mysql/etc/my.cnf

[Mysqladmin]

User=zabbix

password=ys_test0418

Socket=/usr/local/mysql/mysql.sock

# give MySQL users access rights

[Email protected]_test_dbm2_3_13 mysql]# chown-r mysql.mysql/usr/local/mysql/etc/my.cnf

[Email protected]_test_dbm2_3_13 mysql]# chmod u+x/usr/local/mysql/etc/my.cnf

[[Email Protected]_test_dbm2_3_13 mysql]#

# Reboot under, because I found not to restart the words, does not take effect

[[Email protected]_test_dbm2_3_13 mysql]# service MySQL restart

Shutting down MySQL. [OK]

Starting MySQL. [OK]

[[Email Protected]_test_dbm2_3_13 mysql]#

Then go to the Zabbix server to verify that you can obtain data information to the MySQL server:

[Email Protected]_test_121_12 ~]#/usr/local/zabbix/bin/zabbix_get-s 192.168.13.13-p10050-k Mysql.status[Uptime]

154408

[[Email Protected]_test_121_12 ~]#

Bty: Thank the Netizen wood pointing

Reference article: http://dev.mysql.com/doc/refman/5.6/en/password-security-user.html

zabbix3.0 monitoring MySQL service password-free login problem Troubleshooting detailed process

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.