"Mysql" often uses instructions--Forget password

Source: Internet
Author: User

The previous article basically summarizes the next myql how to create a user by instruction. See: "Mysql" often uses instructions-user actions (create, authorize, change. Delete


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

Re-installed. Delete configuration, etc. to complete this operation. What if it doesn't reload?


Principle:

By adding a start parameter:--skip-grant-tables skips grant-tables to start the database so that it does not need to be password to get in.


Here to play:

Under Linux:

1. Close the MySQL process. It should be. Analogy: Service mysql stop or Ps-ef | grep MySQL Kill (Mysqlpid) also has rcmysqld stop and so on.

2. Add start-up: Ability to edit/etc/my.ini or/etc/my.cnf files, add boot parameters --skip-grant-tables can also use command:/usr/bin/mysqld_safe-- Skip-grant-tables & to start MySQL

3, no password into the system changes Password:mysql-u root-p can be.


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

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

2, the use of--skip-grant-tables 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 it in vain.


Just assume the MySQL installation has a problem without the mysqld command. Be able to go to the bin of the installation folder, or configure the PATH environment variable.

4, stop not to start by this parameter can be.







"Mysql" often uses instructions--Forget password

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.