Fast solution for Mysql forget root password or permissions error on Mac _mysql

Source: Internet
Author: User
Tags mysql in

Recently a period of time in the mantis found that always connect MySQL error, it is readily modified root permissions, resulting in no login.

Let's share the easiest way to restore root permissions and change the root password.

1: Install MySQL Workbench. Direct operation of the visual interface.

2: Apple-> System Preferences-> The bottom of the MySQL in the pop-up page to shut down the MySQL service

3: Enter the terminal

Input:

cd/usr/local/mysql/bin/

Login Administrator right after carriage return

sudo su

Enter the following command to disable the MySQL validation function after entering the carriage

./mysqld_safe--skip-grant-tables &

After the return of the MySQL will automatically restart, restart after the MySQL Workbench to create a random connection, and then the user name fill root (note that this will not verify the password, so fill in the account as long as the existence can be).

Then create a server administration and select the connection you just created.

Double-click the Server administration

Click on the security on the left, you can see all the User Rights table, this time you want to do all the right

Here is a partial description:

In the User Rights table

Limit connectivity to Hosts Matching indicates that the login address limit is the IP address at the time of login, '% ' represents any

Adminstrative roles is a privilege, if you find that your root does not have administrator rights, click on this tab all tick

Here are the other commands

/mysqladmin-u root-p Password 123//change root password
/mysql-uroot-p//root user login MySQL

The following are common errors

ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)

Stating that you have insufficient root permissions, you can refer to the above steps to set permissions

Access denied; Your need (at least one of) the SUPER privilege (s) for this operation

Stating that you have insufficient root permissions, you can refer to the above steps to set permissions

The above is a small set up to introduce the Mac MySQL forgot root password or permissions of the fast solution, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.