Create a new user in mysql. First, log on with the root permission to create the user SQL code create user username identified by 'Password '; www.2cto.com this user can log on to the database in any place. The SQL code create user username @ ip identified by 'Password'; the SQL code grant privileges on database is limited to the login host for new users. table to user @ ip identified by "password" select, insert, update, delete, all in this way, the changes to the database are immediately written into the memory, takes effect immediately, no need to restart the server, but after logging on as a new user, the system prompts ERROR 1045 (28000): Access denied for user 'database' @ 'localhost' (using password: YES) www.2cto.com anonymous users need to be deleted to log on to the SQL code use mysql select host, user from mysql as root; several records with empty user items are found, delete the SQL code delete from mysql where user = ""; the operation still involves permissions, but the non-grant operation does not instantly write the memory, or restart, or the SQL code flush privileges;