Hack and reset MySQL password

Source: Internet
Author: User
Tags safe mode

- hack and reset mysql password

Password this thing, always have to forget the time, or is suddenly not recorded, or is the hand of the handover when no one told you, or old to even old leader also forget the database, the problem is to use or to use, then it cracked Bai.

#先关闭mysqlservice mysqld stop# Enter Safe mode, can be password-free login/usr/local/mysql/bin/mysqld_safe--skip-grant-tables--skip-networking & #免密码登陆/usr/local/mysql/bin/mysql-uroot# Change password, password and user selectable, choose what user environment you want to update mysql.user set Password=password (' New password ') where user= ' root ' and host= ' root ' or host= ' localhost ' or host= ' localhost.localdomain ' or host= ' 127.0.0.1 '; After 5.7, update the Mysql.user set Authentication_string=password (' New password ') with the new field, where user= ' root '; #刷新策略flush privileges;# Restart Mysql/etc/init.d/mysqld restart# Normal login/usr/local/services/mysql/bin/mysql-uroot-p ' new password ' #测试功能是否正常mysql > show Databases

It's also simple, but keep in mind that you don't affect existing data.



Hack and reset MySQL password

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.