How can I solve the problem of missing mysql root Password or wrong permissions on mac?

Source: Internet
Author: User

The root password of mysql on mac is forgotten or the permission is incorrect. In the past few days, mantis found that the connection to mysql is always wrong, and the root permission is changed, causing login failure. The following are the most convenient methods to restore root permissions and change the root password. 1: Install mysql workbench. Directly operate on the visual interface. 2: Apple-> system preference settings-> at the bottom of the page, click mysql to close the mysql service on the pop-up page. 3. Enter the terminal: cd/usr/local/mysql/bin/press enter and then log on to the Administrator permission sudo su press enter and enter the following command to disable mysql verification. /mysqld_safe -- skip-grant-tables & press enter to restart mysql automatically. After restart, enter mysql workbench to create a connection and enter root as the username (note that the password will not be verified here, therefore, you only need to enter an existing account ). Create a server administration and select the connection you just created. Double-click server administration and click security on the left side. All user permission tables are displayed on the right side. You can do whatever you want. The following are some instructions: in the user permission table, Limit Connectivity to Hosts Matching indicates the logon address Limit, that is, the IP address used for Logon. '%' indicates that any Adminstrative Roles is the permission. If you find that your root account has no administrator permission, click this tab and select all other commands. /mysqladmin-u root-p password 123 // change the root user password. /mysql-uroot-p // the following common ERROR occurs when the root user logs on to mysql: ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: YES) if your root permission is insufficient, you can refer to the above steps. Set the permission to Access denied; you need (at least one of) the SUPER privilege (s) for this operation indicates that your root permission is insufficient, you can refer to the above steps to set permissions so far my database has finally been retrieved ~~

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.