MySQL 如何使用 mysqladmin 刷新主机解除阻塞

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22285318/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 20:09:29  来源:igfitidea点击:

How to unblock with mysqladmin flush hosts

mysqlmysql-workbench

提问by kar

I have gone through similar cases listed here but it doesn't seem to work.

我经历过这里列出的类似案例,但它似乎不起作用。

I was using MySQL Workbench to establish a connection with my database which is hosted on another server. Tried a few times and unable to connect followed by this error. I am confused as to where I should even do this flush. On PhpMyadmin under the SQL query? Cos when I tried to input the following command, it returns as syntax error. I am using a windows OS thus no shell shell scripting for me to input this information either. I am accessing the database temporarily via Cpanel/ phpmyadmin now.

我正在使用 MySQL Workbench 与托管在另一台服务器上的数据库建立连接。尝试了几次,无法连接,然后出现此错误。我什至不知道我应该在哪里做这个冲洗。在PhpMyadmin 下的SQL 查询?因为当我尝试输入以下命令时,它返回为语法错误。我使用的是 Windows 操作系统,因此也没有 shell shell 脚本让我输入此信息。我现在正在通过 Cpanel/phpmyadmin 临时访问数据库。

Please help to tell where I should input this data and if my syntax is wrong. Thanks for help.

请帮助告诉我应该在哪里输入这些数据以及我的语法是否错误。感谢帮助。

mysqladmin flush-hosts;

or

mysqladmin -umyname -pmypassword flush-hosts;

My error message as follows:

我的错误信息如下:

Failed to connect to MYSql at 192...* with user myName

Host 'host-92...*.as13285.net' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

无法在 192 连接到 MYSql 。. .* 与用户 myName

主机'host-92。. .*.as13285.net' 因连接错误较多而被阻塞;使用 'mysqladmin flush-hosts' 解除阻塞

回答by Michael - sqlbot

mysqladminis not a SQL statement. It's a little helper utility program you'll find on your MySQL server... and "flush-hosts" is one of the things it can do. ("status" and "shutdown" are a couple of other things that come to mind).

mysqladmin不是 SQL 语句。这是一个小助手实用程序,您可以在 MySQL 服务器上找到它……而“刷新主机”是它可以做的事情之一。(“状态”和“关机”是想到的其他一些事情)。

You type that command from a shell prompt.

您可以从 shell 提示符键入该命令。

Alternately, from your query browser (such as phpMyAdmin), the SQL statement you're looking for is simply this:

或者,从您的查询浏览器(例如 phpMyAdmin),您要查找的 SQL 语句很简单:

FLUSH HOSTS;

http://dev.mysql.com/doc/refman/5.6/en/flush.html

http://dev.mysql.com/doc/refman/5.6/en/flush.html

http://dev.mysql.com/doc/refman/5.6/en/mysqladmin.html

http://dev.mysql.com/doc/refman/5.6/en/mysqladmin.html

回答by Syeful Islam

You should put it into command line in windows.

你应该把它放到windows的命令行中。

mysqladmin -u [username] -p flush-hosts
**** [MySQL password]

or

或者

mysqladmin flush-hosts -u [username] -p
**** [MySQL password]

For network login use the following command:

对于网络登录,请使用以下命令:

mysqladmin -h <RDS ENDPOINT URL> -P <PORT> -u <USER> -p flush-hosts
mysqladmin -h [YOUR RDS END POINT URL] -P 3306 -u [DB USER] -p flush-hosts 

you can permanently solution your problem by editing my.ini file[Mysql configuration file] change variables max_connections = 10000;

您可以通过编辑 my.ini 文件[Mysql 配置文件] 更改变量 max_connections = 10000 来永久解决您的问题;

or

或者

login into MySQL using command line -

使用命令行登录 MySQL -

mysql -u [username] -p
**** [MySQL password]

put the below command into MySQL window

将以下命令放入 MySQL 窗口

SET GLOBAL max_connect_errors=10000;
set global max_connections = 200;

check veritable using command-

使用命令检查名副其实

show variables like "max_connections";
show variables like "max_connect_errors";

回答by FindOutIslamNow

You can easily restart your MySql service. This kicks the error off.

您可以轻松地重新启动 MySql 服务。这会引发错误。