MySQL is treated as a permission operation, after adding a user or other table operations. There are two ways to take effect, one is to restart the service, and the other is to use the flush command. Second, you must have the reload permission to use flush.
The following are the main parameters of the flush command.
Hosts clears the host cache table. If some of your hosts change the IP number, or if you get the error message host... isblocked, you should clear the host table. When connecting to the MySQL server, more than max_connect_errors errors occur continuously on a given host. MySQL determines that something is wrong and blocks further connection requests from the host. Clear the host table to allow the host to try again. See 18.2.3 host'... 'isblocked error ).
Logs closes and then opens the standard and update record files. If you specify an update record file without an extension, the extension number of the new update record file will be 1 higher than that of the previous file.
Privileges reloads permissions from the MySQL database authorization table. Close all open tables in tables.
Status resets most status variables to 0.
In general, for example, after adding a user or modifying the permissions of a user, you need to use the flush command to follow the privileges parameter.
Flush privileges;