mysql> show processlist;
+----+----------------------+-----------------+------+---------+------+------------------------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+----------------------+-----------------+------+---------+------+------------------------+------------------+
| 4 | event_scheduler | localhost | NULL | Daemon | 1532 | Waiting on empty queue | NULL |
| 10 | root | localhost | NULL | Query | 0 | starting | show processlist |
| 38 | unauthenticated user | connecting host | NULL | Sleep | 29 | login | PLUGIN |
+----+----------------------+-----------------+------+---------+------+------------------------+------------------+
3 rows in set (0.00 sec)

解决MySQL出现大量unauthenticated user的问题 - phphot - CSDN博客 https://blog.csdn.net/phphot/article/details/4134913

MySQL Bugs: #6070: "unauthenticated user" "reading from net" process hangs https://bugs.mysql.com/bug.php?id=6070

mysql> show global variables like "%name%";
+-----------------------------------+---------------------------------+
| Variable_name | Value |
+-----------------------------------+---------------------------------+
| hostname | d |
| innodb_buffer_pool_filename | ib_buffer_pool |
| lc_time_names | en_US |
| log_bin_basename | /data/mysql/datadir/binlog |
| lower_case_table_names | 0 |
| relay_log_basename | /data/mysql/datadir/d-relay-bin |
| skip_name_resolve | OFF |
| validate_password.check_user_name | ON |
+-----------------------------------+---------------------------------+
8 rows in set (0.00 sec)

mysql>

通过命令行修改 失败

mysql> set global skip_name_resolve=1;
ERROR 1238 (HY000): Variable 'skip_name_resolve' is a read only variable
mysql>

修改

my.cnf

[mysqld]添加

skip_name_resolve=1

重启mysqld

(1130, "Host '127.0.0.1' is not allowed to connect to this MySQL server")

MySQL :: MySQL 8.0 Reference Manual :: 8.12.4.2 DNS Lookup Optimization and the Host Cache https://dev.mysql.com/doc/refman/8.0/en/host-cache.html

Using the --skip-host-cache option is similar to setting the host_cache_size system variable to 0, but host_cache_size is more flexible because it can also be used to resize, enable, and disable the host cache at runtime, not just at server startup. Starting the server with --skip-host-cache does not prevent changes to the value ofhost_cache_size, but such changes have no effect and the cache is not re-enabled even if host_cache_size is set larger than 0 at runtime.

To disable DNS host name lookups, start the server with the --skip-name-resolve option. In this case, the server uses only IP addresses and not host names to match connecting hosts to rows in the MySQL grant tables. Only accounts specified in those tables using IP addresses can be used. (A client may not be able to connect if no account exists that specifies the client IP address.)

mysql> select * from user;
+-----------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+------------------------------------------------------------------------+------------------+-----------------------+-------------------+----------------+------------------+----------------+------------------------+---------------------+--------------------------+
| Host | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Create_tablespace_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | plugin | authentication_string | password_expired | password_last_changed | password_lifetime | account_locked | Create_role_priv | Drop_role_priv | Password_reuse_history | Password_reuse_time | Password_require_current |
+-----------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+------------------------------------------------------------------------+------------------+-----------------------+-------------------+----------------+------------------+----------------+------------------------+---------------------+--------------------------+
| localhost | mysql.infoschema | Y | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | N | 2018-12-21 17:31:02 | NULL | Y | N | N | NULL | NULL | NULL |
| localhost | mysql.session | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | N | 2018-12-21 17:31:02 | NULL | Y | N | N | NULL | NULL | NULL |
| localhost | mysql.sys | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | N | 2018-12-21 17:31:02 | NULL | Y | N | N | NULL | NULL | NULL |
| localhost | root | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 | mysql_native_password | *5180F4AB915BCBB8DFF27EB412C82E08E898CF18 | N | 2018-12-24 17:18:18 | NULL | N | Y | Y | NULL | NULL | NULL |
+-----------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+------------------------------------------------------------------------+------------------+-----------------------+-------------------+----------------+------------------+----------------+------------------------+---------------------+--------------------------+
4 rows in set (0.00 sec)

最新文章

  1. C#复习①
  2. async/await 异步编程(转载)
  3. sqlplus使用(一)
  4. 获取iframe的元素并进行操作
  5. php高并发状态下文件的读写
  6. DIV布局-高度不同DIV,自动换行并对齐
  7. linux 常用的基本命令
  8. Rxjava, RxAndroid, Retrofit 等库的使用
  9. Golang学习 - unicode/utf16 包
  10. Android-xUtils框架介绍(一)
  11. [light oj 1328] A Gift from the Setter
  12. win7 变WIFI热点 & 在线Linux 内核代码
  13. JS中escape 方法和C#中的对应
  14. while read line无法循环read文件
  15. display 与 visibility
  16. 2014 BDTC 參会有感
  17. 【LeetCode练习题】Partition List
  18. TortoiseGit - 版本回退
  19. 如何将excel导入到数据库中并在gridview中显示
  20. zk reconnect

热门文章

  1. 【转载】C# 快速高效率复制对象另一种方式 表达式树
  2. Jquery实用代码片段(转)
  3. C++/CLI中class成员声明与实现分开在不同文件时必须添加namespace
  4. 前台的js对象数组传到后台处理。在前台把js对象数组转化为json字符串,在后台把json字符串解析为List<>
  5. VMware Host Agent服务不能正常启动
  6. hadoop基础学习---数据管理策略
  7. 讨论CSS中的各类居中方式
  8. 关于Java 枚举类型的自定义属性
  9. 2.1 C语言下的位运算
  10. Ubuntu12.04 Skype4.2 提示Skype can't connect,安装Skype4.3