MySQL Security Knowledge Essentials (II.)

Source: Internet
Author: User

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.)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.