核查命令
核查命令
ss -lntp | grep 3306
mysql -e "SELECT user, host FROM mysql.user WHERE host <> 'localhost';"
mysql -e "SELECT user, host FROM mysql.user WHERE authentication_string = '' OR authentication_string IS NULL;"
# 检查 bind-address 与匿名账号收敛与基线
收敛与基线
mysql_secure_installation
# 依次处理:匿名账号、远程 root、test 库、权限刷新
# my.cnf 中 bind-address = 127.0.0.1(或管理网段网卡地址)业务确需远程访问时,用具体来源网段账号 + 防火墙白名单,比全开 % 可控得多。