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!