So basically what is the difference of '%' and 'localhost' when you create a user and give a grant to the created user.
what will happens when you create/grant a user with 'localhost' and '%' each
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
vs
CREATE USER 'user'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON db.* TO 'user'@'localhost';
vs
GRANT ALL PRIVILEGES ON db.* TO 'user'@'%';
it seems like if I create a user with 'localhost' it means I can only log in the user in the local server, not from remote. and in terms of the grant with 'localhost', is that mean that the user only can access to database from local server, not from remote, is that correct?