Tag: Name error Ken exists for password word success password
1. Modify the user name
You can use the Rename user statement to modify the name of an existing SQL user.
Syntax format:
Renane USER Old_user to New_user,
[, Old_user to New_user] ...
Note: Old_user is a SQL user that already exists, New_user is a new SQL user.
The RENAME user statement is used to rename the original MySQL account. To use the rename user, you must have the global Create user permission or the MySQL database update permission. If the old account does not exist or the new account already exists, an error will occur.
Example: Change the name of user King to Ken
Rename User
' King ' @ ' Loacalhost ' to ' ken ' @ ' Loacalhost ';
You can use the above method to see if the modification is successful after completion.
2. Change the password
To modify a user's login password, you can use the Set password statement.
Syntax format:
SET PASSWORD [For User]=password (' NewPassword ')
Note: If you do not add a for user, the current user's password is modified. A for user is modified to modify the password of a specific user on the current host, user name, and its value must be given in the format ' user_name ' @ ' host_name '.
MySQL Security Knowledge Essentials (II.)