What to do if MySQL loses or forgets a password under UNIX

Source: Internet
Author: User

What if you forget your MySQL password one day? Of course I hope this kind of thing doesn't happen, if it happens, follow.

me! Tell you how to modify your MySQL password without completely forgetting the MySQL password

First: We have to turn off the MySQL service and we can use PS aux | grep MySQL finds the process number and kills it.
# kill-9 MySQL Process number

Second: Start MySQL with--skip-grant-table parameters
# Mysql_safe--skip-grant-table&

Third: We can change the password, assuming the change to Mysqlpassword
# mysql MySQL
mysql> Update user Set Password=password (' Mysqlpassword ') where user= ' root ';
mysql> flush Privileges;
Mysql> exit

Last: We turn off the MySQL service running in the background again

#kill-9 MySQL process number
#/service mysqld Start
# Mysql-uroot-pmysqlpassword

This article from "Like Rain like fog and like Wind" blog, please be sure to keep this source http://31521194.blog.51cto.com/10762166/1739460

What to do if MySQL loses or forgets a password under UNIX

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.