MYSQL grant with modify user password

Source: Internet
Author: User

MYSQL creates the user, and authorizes, modifies the password.


Create a user and grant all permissions to law

Create user [email protected];

Grant all privileges on * * to [e-mail protected] identified by ""; ----OK


Create a local user blank password and grant the relevant selection, update and other permissions, and can only be used for MySQL database.

Create user [email protected];

Grant Select,update,insert on mysql.* to [e-mail protected] identified by "";

Change Law's password

mysql> Set password for [email protected] = "123.law";

ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number

When you enter a 123.law password directly, you will be prompted with an error, where you need to convert the password to 16 binary.

The command is:

Select Password ("123.law");


mysql> Select password (' 123.law ');

+-------------------------------------------+

| Password (' 123.law ') |

+-------------------------------------------+

| *2ffdfcdc4937db95ac813d3962becf39b3d78be3 |

+-------------------------------------------+

1 row in Set (0.00 sec)

After you get a string of 16 passwords, execute the command again:

********************************************************************************************

* Set password for [email protected] = "*2ffdfcdc4937db95ac813d3962becf39b3d78be3"; *

*******************************************************************************************




The following is the official MySQL execution command when executing phpmyadmin:

REVOKE all privileges on *. * from ' lisa ' @ '% ';


REVOKE GRANT OPTION on *. * from ' lisa ' @ '% ';


GRANT SELECT,

INSERT,

UPDATE,

DELETE on *. * to ' Lisa ' @ ' percent ' with max_queries_per_hour 0 max_connections_per_hour 0 max_updates_per_hour 0 max_user_connections 0;


This article is from the "Overlord Collected Works '" blog, please be sure to keep this source http://zhangtainren.blog.51cto.com/448826/1539386

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.