Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list the allowed ip that can login mysql?

Tags:

mysql

I know use the bellow commands, can allow a remote ip to login MySQL:

GRANT select,insert,update,delete ON *.* TO root@"my_ip" IDENTIFIED BY "my_password";
FLUSH PRIVILEGES;

But how can I list the allowed IPs that can login the MySQL?

like image 254
aircraft Avatar asked Dec 24 '22 13:12

aircraft


1 Answers

SELECT User, Host FROM mysql.user; 

Will show you all users, and their allowed IP (ranges) in column host.

User Host
user_LAN_3 192.168.1.3
user_DMZ_4 192.168.2.4
user_DMZ_ALL 192.68.2.%
user_LAN_DMZ_ALL 192.168.%
please_dont_do_that %
local_web_app localhost
mysql.infoschema localhost
mysql.session localhost
mysql.sys localhost
root localhost
sysadmin localhost
like image 124
Thomas G Avatar answered Jan 07 '23 20:01

Thomas G