MySQL root Password forgot Solution

Source: Internet
Author: User

MySQL root Password forgot Solution
Summary in many cases, the default password of the root user is not blank after mysql is installed. In this case, you need to log on to mysql to reset the password. Step 1: View/root /. mysql is installed in the mysql_secret file. A random password is generated for the first time. You can use this password to log on. A random password has been generated in '/root /. mysql_secret '.. Method 2: mysqladmin cannot change the password mysqld_safe -- skip-grant-tables & mysql-uroot-p use mysql; update user set PASSWORD = password ("newpassword ") where user = "root"; flush privileges; quit method 3: Add "skip-grant-tables" in/etc/my. in the cnf [mysqld] configuration section, add "skip-grant-tables" to restart mysql service mysqld restart and log on to mysql-uroot-p mysql use mysql; update user set password = password ("password") where user = 'root'; update Flush privileges; delete/etc/my. in the cnf [mysqld] configuration section, "skip-grant-tables" restart mysql service mysqld restart using the new password to log on to mysql-uroot-p. After changing the password, the first logon may report an ERROR of 'error 1820. (HY000): You must set password before executing this statement '. You need to change the current logon PASSWORD again. Change the current user password set password = PASSWORD ('20140901 ')

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.