Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL 5.7.17 startup log showing [Note] Access denied for user 'UNKNOWN_MYSQL_USER'

Tags:

I have MySQL Community Server version 5.7.17 running on Centos 6, everything comes with clean install, Centos 6 installed with "minimal" options, MySQL installed by official yum repo.

When I start MySQL server, the log "/var/log/mysqld.log" showing:

[Note] Access denied for user 'UNKNOWN_MYSQL_USER'@'localhost' (using password: NO)

It appears at the last line of the log, I tried to:

mysql> select * from mysql.user;

I can only see "root" and "mysql.sys" which comes by default, may I know what is the user 'UNKNOWN_MYSQL_USER'@'localhost'? is that something new in the version 5.7.17?

Thanks.

like image 419
watoan Avatar asked Feb 19 '17 16:02

watoan


2 Answers

Nothing to worry about :) You are receiving this message because someone/something tried to access MySQL server, but connection failed. You can reproduce this behaviour by attempting to connect to MySQL with wrong user and/or password and watch the error log file.

In your case, looks like it's the /etc/init.d/mysqld itself trying to test if MySQL server is up and running.

TIMEOUT="$STARTTIMEOUT"
while [ $TIMEOUT -gt 0 ]; do
   RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`

By default, in MySQL 5.7 the error log verbosity is set to 3 (errors, warnings and notes), this is why you're seeing this message in the error log file.

mysql> show variables like 'log_error_verbosity';
+---------------------+-------+
| Variable_name       | Value |
+---------------------+-------+
| log_error_verbosity | 3     |
+---------------------+-------+
like image 99
BlogBuffer Avatar answered Sep 24 '22 11:09

BlogBuffer


I think it's just Mysql script to make sure your Mysql server db secure or not. If your log doesn't show this line, it mean they can access to db with 'UNKNOWN_MYSQL_USER'@'localhost' without password.

like image 40
BongSey Avatar answered Sep 25 '22 11:09

BongSey