MySQL users changed their IP address. What's the best way to deal with this?

Apparently, the right way to do this is:

RENAME USER user@ipaddress1 TO user@ipaddress2;

http://dev.mysql.com/doc/refman/5.0/en/rename-user.html

This takes care of all the grants.


Just update the host field in your MySQL user table:

update mysql.user set Host = 'newIP' where Host = 'oldIP';
flush privileges;

If you have a dedicated subnet for your VPN users the following syntax works well.

GRANT ALL ... user_name@'192.168.1.%'