How to forget the mysqlroot password _ MySQL

Source: Internet
Author: User
The solution for forgetting the mysqlroot password is bitsCN. in comwindows, 1. stop the MYSQL service. In CMD, open the DOS window, enter net stop mysql2, and in the CMD command line window, enter the MySQL installation directory, such as d:/MySQL/bin3, skip the mysql permission checklist, that is, when mysql is up, it can enter the database without entering a password. Command: mysqld-nt -- skip-grant-tables4, re-open a CMD command line window, enter mysql-uroot-p, use the empty password to log on to MySQL (do not enter the password, press enter) 5. enter the following command to modify the password of the root user mysql> update mysql. user set password = PASSWORD ('newpass') where user = 'root'; 6. refresh the permission table mysql> flush privileges; 7. exit mysql> quit.
1. shell> whereis mysqld_safe in linux
2. shell> path/to/mysqld_safe -- skip-grant-tables
3. open the new terminal shell> mysql-uroot-p, empty password to log on to MySQL
4. mysql> update mysql. user set password = PASSWORD ('newpass') where user = 'root'
5. mysql> flush privileges;/q
6. mysqladmin-uroot-p 'newpass' shutdown to disable MySQL service bitsCN.com

The above is the solution to forget the mysql root password _ MySQL content. For more information, please follow the PHP Chinese network (www.php1.cn )!

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.