Mysql5.7.13 forgot password and create user

Source: Internet
Author: User

MySQL 5.7.13 reset root password: 1.my.nin file in [mysqld] under Add skip-grant-tables2.cmd:net start Mysql-mysql-use MySQL; -update user SET Authentication_string=password (newpassword) WHERE user=root; -flush privileges; -quit;3. Landing
MySQL 5.7.13 reset root password: 1.my.nin file added "Skip-grant-tables" under [Mysqld] 2.cmd:net start Mysql->mysql->use mysql;-> UPDATE user SET Authentication_string=password ("NewPassword") WHERE user= ' root ';->flush privileges;->quit;3. When landing, will my.min file "skip-grant-tables" Delete login mysql-u user-p password; If logged in error 1820, login Mysql-u-P Enter: input mysql> SET PASSWORD = PASSWORD (' 123456 '); Create User: Yzkj;update user set Authentication_string=password ("123456") where user= "yzkj"; grant all on hzx.* to ' YZ KJ ' @ ' localhost '; Create user text;update user set Authentication_string=password ("123456") where user= "text"; Grant all text.* to ' text ' @ ' localhost '; 3. Refresh the database (be sure to remember to refresh) Mysql>flush privileges; quitmysql-uyzkj-p123456 Success!

  

Mysql5.7.13 forgot password and create user

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.