1、vim /etc/httpd/conf.d/phpMyAdmin.conf
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip my-server-ip-here
Require ip ::1
Require ip 123.456.789.1 #add your IP
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
# Deny from All
Allow from my-server-ip-here
Allow from ::1
Allow from 123.456.789.1 #add your IP
</IfModule>
</Directory>
2、https://www.whatismyip.com/ 这个网址查询自己的ip.