Reset password after MySQL forgot password (Mac)

Source: Internet
Author: User
Tags mysql in

Ext.: http://www.cnblogs.com/lihuanqing/p/5623872.html

After the installation of MySQL, the system gave a default password, and then accidentally shut down, miserable password is not.

1. Shut down MySQL server sudo/usr/local/mysql/support-files/mysql.server stop can also have a MySQL in System preferences.

This is not required if the service is not started.

2. Cd/usr/local/mysql/bin into the catalogue

3. sudo su get permission

4./mysqld_safe--skip-grant-tables & Restart Server

5, re-open a terminal,

6, Configuration Short command: Alias Mysql=/usr/local/mysql/bin/mysql

7. Input MySQL into MySQL command mode

8. Use MySQL to enter MySQL database

9, flush privileges; probably is to get permission, or he won't let you change.

10. Set password for ' root ' @ ' localhost ' =password (' new password ');

Reset password after MySQL forgot password (Mac)

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.