Crack the local password:
Windows:
1. log on to the system as a system administrator.
2. Stop MySQL services.
3. Go to the Command window and enter the MySQL installation directory. For example, if my installation directory is c: \ mysql, go to C: \ mysql \ bin.
4. Skip the permission check and start MySQL,
C: \ mysql \ bin> mysqld-nt -- skip-grant-tables
Or c: \ mysql \ bin> mysqld -- skip-grant-tables
Mysqld.exe is a program related to the database server of Microsoft Windows MySQL server.
Mysqld-nt.exe is a MySQL Daemon database service related program.
5 .[WeiVerify]
Open a new window
Go to the c: \ mysql \ bin directory and set the new root password.
C: \ mysql \ bin> mysqladmin-u root flush-privileges password "newpassword"
C: \ mysql \ bin> mysqladmin-u root-p shutdown
Replace newpassword with the root password you want to use. The second command will prompt you to enter a new password and repeat the password entered by the first command.
5 .[Verify] Or:
Open a command prompt window again (CMD)
Use a blank password to log on to MYSQL as the root user;
Mysql-u Root
Modify the password of the root user;
Mysql> Update mysql. User SET Password = PASSWORD ('new password') where user = 'root ';
Mysql> flush privileges;
Mysql> quit
6. Stop MySQL server and start MySql in Normal Mode
7. You can use a new password to link to MySQL.
UNIX & Linux:
1. log on to the system using root or a user running mysqld;
2. Use the kill command to end the mysqld process;
3. Use the-Skip-grant-tables parameter to start MySQL Server
Shell> mysqld_safe-Skip-grant-tables &
4. Set a new password for root @ localhost
Shell> mysqladmin-u root flush-Privileges password "newpassword" 5. Restart MySQL Server
Appendix:
MySQL password change method Daquan:
Mysql> update user set Password = password ('newpassword') where User = 'root ';
Mysql> flush privileges;
MYSQLADMIN-u root-p PASSWORD mypasswd
You can modify the MY. ini file in the MYSQL folder.
Mysql> set password for myuser @ localhost = PASSWORD ('mypasswd ');
Mysql> grant usage on *. * TO myuser @ localhost identified by 'mypassword ';