"Mysql" common instruction--forget password

Source: Internet
Author: User

The previous article basically summed up the next myql under the instructions how to create a user, see: "Mysql" common instructions--user action (create, authorize, modify, delete)


Today, the special situation, forget the password what to do???

This can be done by reloading, deleting the configuration, and so on. What if it doesn't reload?


Principle:

By increasing the startup parameters:--skip-grant-tables skips grant-tables to start the database, so you can go in without a password.


below to play:

Under Linux:

1, shut down the MySQL process, should be Kazakhstan for example: service mysql stop or Ps-ef | grep MySQL Kill (Mysqlpid) also has rcmysqld stop and so on.

2, increase the startup parameters: You can edit/etc/my.ini or/etc/my.cnf file, increase the startup parameters --skip-grant-tables can also use the command:/usr/bin/mysqld_safe-- Skip-grant-tables & to start MySQL

3, no password to enter the system Change Password: Mysql-u root-p can be.


The same is true under window, but the operation is not the same.

1, My Computer right button "management" service "find MySQL and stop or win+r run cmd and then run the net stop MySQL

2, use the --skip-grant-tables parameter to start the database.

C:\users\wj>net Stop Mysqlmysql service is stopping: The MySQL service has stopped successfully. C:\users\wj>mysqld--skip-grant-tables

3. Log in with Root, and go for whatever it is.

4. Stop starting with this parameter.






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.