To get a list of MySQL users and their privileges, run this command

root@mysql1:~# mysql -u root -h mysql1 -p Log in to mysql as user root (-u) on host mysql1 (-h) with password (-p)
mysql> select user,host from mysql.user;
user host
root
127.0.0.1
 root 192.168.1.%
 phpuser 192.168.1.% 

If you want to see grants for a particular user, run next command

mysql> show grants for 'root'@'%'; for example, root user

One of useful tips when you are doing migration DB from one server to another is to check all grants for all users and hosts. In my example I use username root and password pillow

root@mysql1:~# mysql -u root -ppillow --skip-column-names -A -e"SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user WHERE user<>''" | mysql -u root -ppillow --skip-column-names -A | sed 's/$/;/g'

Output of previous command will be something like this:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.%' IDENTIFIED BY PASSWORD '36684d606dccb590' WITH GRANT OPTION;

You just need to change (if you change IP addresses) allowed hosts and to copy output of command + flush privileges