Recent projects used to MySQL because the computer MySQL is a long time ago installed root password forgotten, Baidu reset Password
Windows:
1. Log in as a system administrator;
2. Stop the MySQL service;
3. Go to cmd and enter the MySQL installation directory, assuming it is d:/mysql/mysql Server 5.0/;
4. Skip permission Check to start MySQL,
D:/mysql/mysql Server 5.0/bin/mysqld-nt --Skip-grant-tables
5. Reopen a cmd and go to D:/mysql/mysql Server 5.0/bin/,
Reset Root Password
D:/mysql/mysql Server 5.0/bin/mysqladmin-uroot flush-privileges password "NewPassword"
D:/mysql/mysql Server 5.0/bin/mysqladmin-u root-p shutdown
Replace NewPassword with your new password, and the second command will let you enter a new password again.
6. In cmd net start MySQL
Unix&linux:
1. Log in to the system with root or user running mysqld;
2. Use the KILL command to end the process of mysqld;
3. Start MySQL Server with the –skip-grant-tables parameter
#mysqld_safe –skip-grant-tables &
4. Then use the root user login Mysql;mysql-u root with a blank password
5. Set a new password for [email protected]
mysql> Update Mysql.user Set Password=password (' New password ') where user= ' root ' mysql> flush privileges;mysql> quit
6. Restart MySQL
Note that the place of the red callout is two "-". Do not let name execution will error "-K ..."
MySQL Reset root password