2016-12-25 82 views
0

我最近注意到,在我的/var/log/mysql/error.log我不断收到以下:MySQL的失败的登录尝试在启动

版本:“5.7.16-0ubuntu0.16.04。 1'socket: '/var/run/mysqld/mysqld.sock'port:3306(Ubuntu) 2016-12-25T17:36:06.356990Z 2
[Note]访问被拒绝用户 'root'@' localhost'(使用密码:NO)

MySQL每次重新启动。我不明白为什么会发生这种情况。我的授权表格很好,我的root用户工作得很好,我可以随时访问它。

这告诉我有什么东西试图在启动过程中登录到服务器,但我不知道在哪里寻找什么来解决这个问题。

任何想法?

编辑1

这里是部分我可以从/etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld] 
# 
# * Basic Settings 
# 
basedir   = /usr 
datadir   = /var/lib/mysql 
tmpdir   = /tmp 
lc-messages-dir = /usr/share/mysql 
skip-external-locking 
# 
# * Fine Tuning 
# 
key_buffer_size   = 16M 
max_allowed_packet  = 16M 
thread_stack   = 192K 
thread_cache_size  = 8 
# This replaces the startup script and checks MyISAM tables if needed 
# the first time they are touched 
myisam-recover-options = BACKUP 
#max_connections  = 100 
#table_cache   = 64 
#thread_concurrency  = 10 
# 
# * Query Cache Configuration 
# 
query_cache_limit  = 1M 
query_cache_size  = 16M 
# 
# * Logging and Replication 
# 
# Both location gets rotated by the cronjob. 
# Be aware that this log type is a performance killer. 
# As of 5.1 you can enable the log at runtime! 
#general_log_file  = /var/log/mysql/mysql.log 
#general_log    = 1 
# 
# Error log - should be very few entries. 
# 
log_error = /var/log/mysql/error.log 
log_warnings = 2 
# 
# Here you can see queries with especially long duration 
#log_slow_queries  = /var/log/mysql/slow.log 
#long_query_time = 2 
#log-queries-not-using-indexes 
# 
# The following can be used as easy to replay backup logs or for replication. 
# note: if you are setting up a replication slave, see README.Debian about 
#  other settings you may need to change. 
#server-id    = 1 
#log_bin      = /var/log/mysql/mysql-bin.log 
expire_logs_days  = 10 
max_binlog_size = 100M 
#binlog_do_db   = include_database_name 
#binlog_ignore_db  = include_database_name 
+0

您能否向我们展示您的my.cnf设置而不分享任何过于敏感的内容?您应该能够在以下某个位置找到它: /etc/my.cnf /etc/mysql/my.cnf $ MYSQL_HOME/my.cnf [datadir] /my.cnf 〜/ .my。 cnf –

+0

在编辑1下添加了详细信息,谢谢。 –

回答

0

分享这是一个奇怪的!我也有这个问题在我的日志,当我检查害得我一搜索,我发现这个职位:https://github.com/andryyy/mailcow/issues/619

继“ADMF的”引领我所做的就是重新启动我的MySQL守护进程,服务mysqld的重新启动,并确认root访问权限被拒绝。然后,我走进了MySQL客户为根,在 '根' 使用ALTER命令@ 'localhost' 的,就像这样:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'YourPassword'; 

然后运行

FLUSH PRIVILEGES 

然后重启MySQL再次

service mysqld restart 

现在失败的登录不再作为日志中启动通知的一部分出现。奇怪的是,我前一段时间已经在我的表格中设置了密码和权限。必须是最近MySQL的更新奇怪的东西,但至少它的作品!

+0

试过,可悲的是它没有做到这一点。是的,我已经设置了密码。 –

+0

我在'Ubuntu 16.04.1 LTS(GNU/Linux 4.4.0-59-generic x86_64)'运行'5.7.16-0ubuntu0.16.04.1',每次mysql服务器启动时都有一个几乎相同的条目,我不能摆脱消息。上述建议没有帮助。 – Vishal