MySQL forgot root password workaround

Source: Internet
Author: User

1. Stop the MySQL service
# Kill ' Cat/var/run/mysqld/mysqld.pid '
# Pkill Mysqld
2. Start the MySQL service using the--skip-grant-tables--skip-networking option
# mysqld--skip-grant-tables--skip-networking--user=mysql
--skip-grant-tables: Skip Authorization Form authentication
--skip-networking: With the Skip authorization table option, all people can log in without a password, which is very insecure, this option does not listen to the network and prevents malicious logons.
3. No password connection to MySQL
# MySQL
4. Reset Password

Use Mysqlupdate user set Password=password ("New_pass") where user= "root";//' new_pass ' here instead of the password you want to set flush Privileges;exit

  

MySQL forgot root password workaround

Related Article

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.