MySQL users changed their IP address. What's the best way to deal with this?
Solution 1:
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.
Solution 2:
Just update the host field in your user's table:
update mysql.users set Host = newIP where Host = oldIP;
flush privileges;
Solution 3:
If you have a dedicated subnet for your VPN users the following syntax works well.
GRANT ALL ... user_name@'192.168.1.%'