纸水仙 发表于 2018-10-10 12:20:48

mysql flush-hosts

  错误信息:
  message from server: "Host 'ip' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"
  1、使用mysqladmin flush-hosts命令清除缓存,命令执行方法如下:
  命令行或终端:mysqladmin-uroot-pflush-hosts
  接着输入root账号密码即可
  2、修改mysql配置文件,在下面添加 max_connect_errors=1000,然后重启mysql
  service mysqld restart
  如果root密码忘记:
  vim /etc/my.cnf
  加入:skip-grant-tables
  重启重新连接时mysql -uroot -p 即可重新输入密码
  其他常用命令:
  1、登录:# mysql -uroot -p
  查看所有库:show databases;
  所有用户:select user,host from user;
  修改root用户连接权限:updateuser set host=’%’where user=’root’
  SETPASSWORD = PASSWORD(‘your new password‘);

页: [1]
查看完整版本: mysql flush-hosts