I am aware of this command:
GRANT ALL PRIVILEGES ON database.* TO \'user\'@\'yourremotehost\' IDENTIFIED BY \'newpassword\';
But then it on
TO 'user'@'%'
% is a wildcard - you can also do '%.domain.com' or '%.123.123.123' and things like that if you need.
'%.domain.com'
'%.123.123.123'