Here is a snippet from the manual
If you change the grant tables directly (for example, by using
DELETEstatements) and your changes seem to be ignored, remember that you must execute a
FLUSH PRIVILEGESstatement or a mysqladmin flush-privileges command to cause the server to reload the privilege tables. Otherwise, your changes have no effect until the next time the server is restarted. Remember that after you change the
rootpassword with an
UPDATEstatement, you will not need to specify the new password until after you flush the privileges, because the server will not know you’ve changed the password yet!