MySQL資料庫限制多次登入失敗重試時間

2021-08-31 07:22:06 字數 1116 閱讀 8973

1、登入資料庫,安裝外掛程式(connection_control和connection_control_failed_login_attempts)

mysql -uroot -p

install plugin connection_control soname 'connection_control.so';

install plugin connection_control_failed_login_attempts soname 'connection_control.so';

2、檢視所有已安裝的外掛程式

3、按需修改配置檔案(/etc/my.cnf)

vim /etc/my.cnf

新增如下兩行配置:

connection-control-failed-connections-threshold=5   #登陸失敗次數限制

connection-control-min-connection-delay=1800000 #限制重試時間,此處為毫秒,注意按需求換算

重新啟動mysql(根據版本選擇重啟命令)

service mysqld restart 或 service mysql restart

4、重新登入資料庫,檢視配置是否生效

5、驗證

輸錯5次密碼後,會發現第6次登入會卡住,限制登入,時間為設定的限制時間30分鐘

登入mysql資料庫 登入mysql資料庫

二 登入mysql 1 以 windowns 命令方式登入 首先 在 cmd命令裡 切換到mysql的bin目錄下 c program files mysql mysql server 8.0 bin cd c program files mysql mysql server 8.0 bin c p...

1 登入mysql資料庫 登入mysql資料庫

二 登入mysql 1 以 windowns 命令方式登入 首先 在 cmd命令裡 切換到mysql的bin目錄下c program files mysql mysql server 8.0 bin cd c program files mysql mysql server 8.0 bin c pr...

pycharm工具連線mysql資料庫失敗問題

在使用pycharm開發工具連線mysql資料庫時提示錯誤pghcxcxudn,資訊如下 server re invalid timezone.go to advanced tab and set servertimezone property manually 提示資訊返回無效的時區,這是由於my...